1234567891011121314151617181920212223242526 |
- #!/bin/rc
- switch($1){
- case *@*
- person=`{echo $1|sed s/@.*//}
- machine=`{echo $1|sed s/.*@//}
- fn boilerplate { sed '1,/^$/d' $* }
- case *.co.uk
- person=`{echo $1|sed s/@.*//}
- machine=whois.nic.uk
- fn boilerplate { sed '/^ +WHOIS database last updated at/,$d' $* }
- case *
- person=$1
- machine=rs.internic.net
- fn boilerplate { sed '1,/^$/d' $* }
- }
- file=/tmp/iwhois$pid
- echo ''$person'' | telnet -n tcp!$machine!whois > $file
- x=`{ sed -n 's/.*Whois Server: (.*)/\1/p' $file }
- switch($x){
- case ''
- ;
- case *
- echo ''$person'' | telnet -n tcp!$x!whois > $file
- }
- boilerplate $file
- rm $file
|