Thanks maro. Speaking of foolish undertakings, I was reminded of endless hours I spent with sed trying to do similar things when converting public forum posts and thread hierarchies into sql commands. That effort still didn't give me the lesson and I still do too many things with sed.
The need for this command line tool or script is to read a dns server's log and also a firewall's log and, every time an ip or domain name is blocked, display a popup that contains good consise whois information about it. Plus a prompt that says something like:
"Allow ip's owned by <Google Inc> next time?"
Or whatever company appears to be the owner. And if you reply yes, then everything that has "Google Inc" as the owner is thereafter allowed.
Can't the owner be reliably extracted from such whois information?