Plan 9 from Bell Labs’s /n/sources/patch/applied/iwhois-more-domains/iwhois.backup

Copyright © 2009 Alcatel-Lucent.
Distributed under the Lucent Public License version 1.02.
Download the Plan 9 distribution.


#!/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

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2009 Alcatel-Lucent. All Rights Reserved.
Comments to webmaster@plan9.bell-labs.com.