[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] finding ip address of host





-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I need to find out the ip address of the host. I have a series 
> of commands that will do it. Anyone have a better way?
> 
> ifconfig eth0 |grep -i inet | cut -f2 -d":" |cut -f1 -d" "

This should work just fine. Is there any reason not to use the above? 
My only small suggestions would be to specify the full path to 
ifconfig (just in case) and to remove the superflous "-i" because 
ifconfig always returns inet lowercase anyway.

Greg Sabino Mullane
greg at turnstep.com
PGP Key: 0x14964AC8 200109180907

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iQA/AwUBO6dHsrybkGcUlkrIEQJonACgg93fAm4DGCqcnc+peVcTWKoKAJcAoJT8
bqeXBLICCkJpVf2mF5SK5xNU
=puRu
-----END PGP SIGNATURE-----

--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.