Click here to Skip to main content
15,798,592 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Bash
#!/bin/bash
# Does a 'whois domain−name' lookup on any of 3 alternate servers:
# ripe.net, cw.net, radb.net
# Place this script, named 'wh' in /usr/local/bin
# Requires symbolic links:
# ln −s /usr/local/bin/wh /usr/local/bin/wh−ripe
# ln −s /usr/local/bin/wh /usr/local/bin/wh−cw
# ln −s /usr/local/bin/wh /usr/local/bin/wh−radb
if [ −z "$1" ]
then
echo "Usage: `basename $0` [domain−name]"
exit 65
fi
case `basename $0` in
# Checks script name and calls proper server
"wh" ) whois $1@whois.ripe.net;;
"wh−ripe") whois $1@whois.ripe.net;;
"wh−radb") whois $1@whois.radb.net;;
"wh−cw" ) whois $1@whois.cw.net;;
* ) echo "Usage: `basename $0` [domain−name]";;
esac
exit 0


Hi I very new to unix . I have been trying to understand this script . But dint find any luck understanding nor in googling. I want some one to explain me the case part.
"whois $1@whois.ripe.net"
any help wil be appreciated
Cheers
Thanks in advance
Posted

1 solution

Have you googled?
http://linux.about.com/library/cmd/blcmdl1_whois.htm[^]
http://en.wikipedia.org/wiki/Whois[^]

This script simply queries a "Whois" server to find out who is the owner of a specific internet resource (domain or IP address).
 
Share this answer
 
v2
Comments
MohamedHassanAli 21-Apr-11 1:22am    
Yes i have but i am still not able figure out what it does
MohamedHassanAli 21-Apr-11 1:23am    
Thanks for your response
:)
MohamedHassanAli 21-Apr-11 1:48am    
So if i understood correct whois $1@whois.ripe.net - $1 = google.com
so this command will look for google.com in whois.ripe.net ? am i correct ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900