The following script will generate domain name and prints the availability of the domain name. You can tweak this script to make it more useful.
for d in $(pwgen -1A0B 6 10); do echo -n "$d.com "; whois -H $d.com | grep -q 'No match for' || echo -n "Not "; echo "Available!..."; done