I need my eth0 IP address in a shell variable.
I don't see an easy solution.
Anybody's idea ?
Thanks
--
Brent Frère
5, rue de Mamer
L-8280 Kehlen
Grand-Duché de Luxembourg
Union Européenne
Tél: +352-021/29.05.98
Fax: +352-26.30.05.96
Web: http://BFrere.net
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