Gentoo Archives: gentoo-user

From: Fredrik <fredrick@×××××××.nu>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] file with IP?
Date: Fri, 04 Nov 2005 18:27:56
Message-Id: 436BA57B.1010202@thegate.nu
In Reply to: Re: [gentoo-user] file with IP? by Billy Holmes
1 ifconfig eth0 | awk 'NR==2 {print $2}' | sed -e s/addr://
2
3 will also work.(you may need to modify it so it fit your own cards)
4
5 //Fredrik
6
7
8 Billy Holmes wrote:
9 > Alexander Skwar wrote:
10 >
11 >> But I actually don't quite like the regexp - it's too long... With
12 >> perl, I'd use a "non-gready" .*, like so:
13 >
14 >
15 > then don't use a regex at all:
16 >
17 > /sbin/ifconfig eth0 | grep inet | cut -d : -f 2 | cut -d ' ' -f 1
18 >
19
20 --
21 gentoo-user@g.o mailing list