$hostName = $ARGV[0]; #Grab command line parameter
$addr1 = inet_aton($hostName); #Get IP address in internal format.
$addr2 = inet_ntoa($addr1); #Get the IP address in dotted notation.
print $addr2; #Print the IP address to standard output.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.