IP address variable?

paul paul.hamradio at verizon.net
Mon Feb 14 21:59:19 UTC 2005



Hello All,
 
I need to create a variable (or read an existing one) that returns the IP 
address for eth0.
I used to do it like this under RH 7.2:

IPADDR='ifconfig eth0|grep inet|cut -d ":" -f2|cut -d " " -f1'

The result now under FC3 is:

# $IPADDR
"inet|cut: Unknown host"

Can anyone help me out here? I am having a hard time figuring this one out.

PD





More information about the fedora-list mailing list