|
|
Geolocate a number of IP addresses via shell script
Nice idea. I wanted it to work without temp files, as a one liner, and with only default Mac OS X apps (curl instead of lynx). I also use Ruby to strip the HTML. The result is below. (I use the TCSH shell, but modifying for Bash should be trivial.) I made an alias of the command and pass it the IP addr argument as variable \!:1. In .tcshrc you would define it as:
Geolocate a number of IP addresses via shell script
textutil is installed on all macs, and can convert between html and text pretty easily. [edit] From 10.4 onwards ;-) I think it uses the same parsing libraries that Apple uses to read .docx stuff, too. fmt is one of: txt, html, rtf, rtfd, doc, docx, wordml, odt, or webarchive HISTORY The textutil command first appeared in Mac OS X 10.4. Edited on Jan 13, '10 11:01:49AM by alblue
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|