31 Aug
2010
31 Aug
'10
9:11 a.m.
Ci dessous des méthodes awk permettant de résoudre un nom en IP et vice versa : --8<-- function ipToName(address) { cmd="host " address while ((cmd | getline line) > 0) { if (line ~ /pointer/) { sub(".*pointer ", "", line) sub("\.$", "", line) return line } else { return address } } } function nameToIp(name) { cmd="host " name while ((cmd | getline line) > 0) { if (line ~ /pointer/) { sub(".*address ", "", line) return line } else { return name } } } --8<-- -- http://asyd.net/home/ - Home Page http://www.guses.org/ - French Speaking (Open)Solaris User Group http://netvibes.com/asyd - Portal