[ILUG] getting IP of machine on DHCP

Garth Fitzmaurice garth at netsoc.ucd.ie
Wed Dec 20 23:31:56 GMT 2000


 
> If you want *just* the IP, you could get it with 
> /sbin/ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | sed 's/ .*$//'

 Is there some reason why you couldn't just use:
 hostname -i
 to get *just* the ip?

 Garth

 





More information about the ILUG mailing list