[olug] Unix Tip: GET YOUR IP-ADDRESS, Omaha Perl Mongers

Jeff Hinrichs jlh at cox.net
Sat Mar 22 23:36:57 UTC 2003


> - But my machine has 16 IPs, and your solution only returns one of them.
> The one that happens to be associated with my "hostname". And when
> you're running 281 domains, "hostname" seems irrelevant.

Doesn't the original tip only return a single one?
 ifconfig | grep "inet addr" |  grep -v "127.0.0.1" | awk '{print $2;}'
|awk -F':' '{print $2;}'

Sorry, but I don't have a machine with multiple ip's to try it on.

-Jeff




More information about the OLUG mailing list