If you have ever used the whois command from Terminal, you know how many lines of legal junk comes along with the few lines of useful information you wanted. It almost always requires me to grab the mouse and scroll up a page or two to reach the vital information, and that is annoyingly wasteful. So in my quest to reduce the clutter, I wrote this ruby script to deal with the output from .com, .net, .org, and unspecified domain extensions.
I apologize in advance to any real ruby programmers out there, as this is the first script I have ever written. As far as I can tell, it works, but I imagine it is pretty inelegant, and I'm sure someone could clean it up and improve upon it. For one thing, I am not sure it deals well with all the options that you can pass to whois, but for just looking up basic details, you don't need any options.
Here's a sample of the output using my improved version of whois:
$ whois macosxhints.com
Domain Name: MACOSXHINTS.COM
Registrar: EMARKMONITOR INC. DBA MARKMONITOR
Whois Server: whois.markmonitor.com
Referral URL: http://www.markmonitor.com
Name Server: S.NS.VERIO.NET
Name Server: D.NS.VERIO.NET
Status: REGISTRAR-LOCK
EPP Status: clientUpdateProhibited
EPP Status: clientTransferProhibited
EPP Status: clientDeleteProhibited
Updated Date: 27-Jun-2005
Creation Date: 20-Nov-2001
Expiration Date: 20-Nov-2006
Last update of whois database: Sun, 10 Sep 2006 18:57:24 EDT
Compare that to the hundreds of lines you'll get from whois macosxhints.com in Terminal, and you can see the space savings. To use the script, copy and paste the source into a new file in your favorite Terminal editor and save it as whois.rb. Make it executable (chmod 755 whois.rb), and you're ready to go. The easiest way to use it is probably via an alias; alias swhois='ruby /path/to/whois.rb. Then you can just type swhois macosxhints.com, for instance, to use the abbreviated version.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060910162248925