Billy Holmes schrieb:
> Alexander Skwar wrote:
>> But I actually don't quite like the regexp - it's too long... With
>> perl, I'd use a "non-gready" .*, like so:
> 
> then don't use a regex at all:
> 
> /sbin/ifconfig eth0 | grep inet | cut -d : -f 2 | cut -d ' ' -f 1
> 

Don't like that - there might be locales, where there's no "inet"
in the line. IMO better:

/sbin/ifconfig eth0 | grep :255\. | cut -d : -f 2 | cut -d ' ' -f 1

How about that:

[EMAIL PROTECTED] ~ $ echo `/sbin/ifconfig ra0` | cut -d : -f 8 | cut -d ' ' -f 
1
192.168.1.11

Alexander Skwar
-- 
gentoo-user@gentoo.org mailing list

Reply via email to