in reply to gethostbyname one-liner: Improvements?
Kudos to kyle++ for a bunch of great ideas, particularly using inet_ntoa() - I had no idea...
Here's the answer to your question on why I need this...
DESTIP=`perl-one-liner("common_host_alias")` remote_command -IP $DESTIP
ikegami++ as always. I've learned something new again (but don't yet understand). I do understand why
gives me a usage error, but I don't understand why adding the "". makes it workinet_ntoa(gethostbyname("www.google.com"))
Unless this is some new form of black magic, it seems that you're simply adding a null in front of that which is returned by gethostbyname(). Why would that have an effect?inet_ntoa("".gethostbyname("www.google.com"))
Lastly, jwkrahn++ for pointing out the unix host(1) command. Unfortunately, the box I'm running this on does not have the command installed.
Thanks
-Craig
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: gethostbyname one-liner: Improvements?
by ikegami (Patriarch) on Jan 21, 2009 at 16:07 UTC | |
|
Re^2: gethostbyname one-liner: Improvements?
by kyle (Abbot) on Jan 21, 2009 at 15:43 UTC |