The idea to write a shell script is often the result of having to do repeated tasks. Imagine having to check hundreds of domain names by typing "whois domain.com" each time. It would take much longer than writing a simple script.
Using whois to Check for Available Domain Names
Suppose you want to find a good domain name, but you want to see if all of the domain suffixes are available? For example, you want a good .com domain, but you also want the .net, and .org. Not only that, but you might want to use blogspot.com, or wordpress.com for your blog.
You can always check a domain availability by using the whois command, e.g.
$ whois google.com
Obviously, google.com is not available, so whois will display information about the company that registered the domain name. If the domain is not taken, then whois will usually return "No match", or "NOT FOUND". You have to keep trying a domain name until you find one that is available. This can be time-consuming to do manually.
Here is a simple shell script to run a whois query on a list of domains.
First, you will need to generate a list of domains to test. Here is an example file:
$ cat test.txt
For details on how to create a large test file see: mktestfile.sh
Then simply run the script using the .txt file you created as a parameter:
$ ./whois_check.sh test.txt
====== 5 unixperformance =====
====== 6 unixinsight =====
====== 2 unixexpert =====
====== 6 unixexpertese =====
sleeping 60 seconds...
====== 6 unixstrategies =====
====== 6 abczzzzz =====
whois_check -- HTML format