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 |