I want to write a shell script that read line by line of a file that have all domain names written, after reading complete file it will give us following output.
Domain Name Expiry Days-Left abcd.com 20-Feb-200 6 10
How can i acheive that script will only print above format.
For example, if you type in unix.com, you will see that whois.godaddy.com will give detailed information about this particular domain name. So you telnet whois.godaddy.com 43 and see what you get when you type unix.com there. Try it again with some other friendly domain names you like, especially outside the .com and .net domains, and weep.
domaintools.com have already solved this problem, by and large, and charge a very reasonable fee. I would simply go there, unless you have a pressing urge to reinvent a very hairy wheel (or no money and lots of time). I don't personally use their services, but those friends of mine who do seem to be very satisified.
I have this output uscast.us - Domain Expiration Date: Sat Dec 13 23:59:59 GMT 2008 better-posture.com - Expiration Date: 17-mar-2009 eonigeria.org - Expiration Date:09-Jul-2014 16:27:43 UTC
alpha-male.ca - Renewal-Date: 2008/12/20
There are many threads on this site about normalizing dates, although it took me a while to come up with a link to one. date conversion is not a particularly brilliant example but might work for you, and has pointers to more.