Gentoo Archives: gentoo-user

From: Alexander Skwar <listen@×××××××××××××××.name>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] file with IP?
Date: Fri, 04 Nov 2005 18:36:34
Message-Id: 436BA847.9060003@mid.email-server.info
In Reply to: Re: [gentoo-user] file with IP? by Billy Holmes
1 Billy Holmes schrieb:
2 > Alexander Skwar wrote:
3 >> But I actually don't quite like the regexp - it's too long... With
4 >> perl, I'd use a "non-gready" .*, like so:
5 >
6 > then don't use a regex at all:
7 >
8 > /sbin/ifconfig eth0 | grep inet | cut -d : -f 2 | cut -d ' ' -f 1
9 >
10
11 Don't like that - there might be locales, where there's no "inet"
12 in the line. IMO better:
13
14 /sbin/ifconfig eth0 | grep :255\. | cut -d : -f 2 | cut -d ' ' -f 1
15
16 How about that:
17
18 alexander@blatt ~ $ echo `/sbin/ifconfig ra0` | cut -d : -f 8 | cut -d ' ' -f 1
19 192.168.1.11
20
21 Alexander Skwar
22 --
23 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] file with IP? Billy Holmes <billy@××××××.net>