begin Tuesday 27 January 2004 10:49, Brent Frère quote:
I need my eth0 IP address in a shell variable.
I don't see an easy solution.
Anybody's idea ?
Thanks
var=`/sbin/ifconfig eth0 | fgrep 'inet addr' | sed 's/.*inet
addr:\([0-9.]*\).*/\1/'`
(Tested on a Fedora Core 1. It's Possible that on other distros a
different regexp is needed)
Alain