1
0

iwhois 584 B

1234567891011121314151617181920212223242526
  1. #!/bin/rc
  2. switch($1){
  3. case *@*
  4. person=`{echo $1|sed s/@.*//}
  5. machine=`{echo $1|sed s/.*@//}
  6. fn boilerplate { sed '1,/^$/d' $* }
  7. case *.co.uk
  8. person=`{echo $1|sed s/@.*//}
  9. machine=whois.nic.uk
  10. fn boilerplate { sed '/^ +WHOIS database last updated at/,$d' $* }
  11. case *
  12. person=$1
  13. machine=rs.internic.net
  14. fn boilerplate { sed '1,/^$/d' $* }
  15. }
  16. file=/tmp/iwhois$pid
  17. echo ''$person'' | telnet -n tcp!$machine!whois > $file
  18. x=`{ sed -n 's/.*Whois Server: (.*)/\1/p' $file }
  19. switch($x){
  20. case ''
  21. ;
  22. case *
  23. echo ''$person'' | telnet -n tcp!$x!whois > $file
  24. }
  25. boilerplate $file
  26. rm $file