ifconfig eth0 | awk 'NR==2 {print $2}' | sed -e s/addr://

will also work.(you may need to modify it so it fit your own cards)

//Fredrik


Billy Holmes wrote:
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


--
gentoo-user@gentoo.org mailing list

Reply via email to