Jan 13, '10 07:30:01AM • Contributed by: Anonymous
#!/bin/bash echo "Put the IPs you want to lookup into a file named list." url="http://www.geoiptool.com/en/?IP=" for i in `cat list` do lynx -dump $url$i > tmp cat tmp | sed -n '/Host Name/,/Postal code/p' rm tmp done
jamesk@HOME~/Desktop $ echo 198.6.1.5 > list jamesk@HOME~/Desktop $ geo Put the IPs you want to lookup into a file named list. Host Name: cache04.ns.uu.net IP Address: 198.6.1.5 Country: [14]United States united states Country code: US (USA) Region: [15]Oregon City: Eugene Postal code:[robg adds: Note that this hint requires the lynx text-only web browser, which you can install via Fink or MacPorts or probably many other methods. I'm sure there's probably a way to do this without lynx, but I'll leave that to those who actually know what they're doing...]
