:internic lookup
:module
:help.m


@ nic.serv = [198.41.0.6]
@ nic.port = 43
eval addhelp inic&inic $(c4)[$(c3)hostname$(c4)]&retrieves internic info on the specified host. 
alias inic {
	if (![$0]) {
		/chelp inic
	}	
	{
		^exec -9 %nic
		@ nhost = [$*]
		^exec -name nic telnet $nic.serv $nic.port
		^on ^exec "nic *" { xecho -c $fparse(format_midbar $1-) }
                ^on ^exec "nic Trying*" #
		^on ^exec "nic Connected to*" #
		^on ^exec "nic The InterNIC*" #
		^on ^exec "nic non-military*" #
		^on ^exec "nic Other*" #
		^on ^exec "nic *American Registry*" #
                ^on ^exec "nic * European IP Address *" #
		^on ^exec "nic * Asia Pacific IP *" #
		^on ^exec "nic * US Military *" #
		^on ^exec "nic * US Government *" { xecho -c $fparse(format_footer nic $nhost) } 
		^on ^exec "nic Escape character is '^]'." { 
			xecho -c $fparse(format_header nic $nhost)
			^exec -in %nic whois $nhost 
		}
		^on ^exec "Connection closed by foreign host*" {
			xecho -c $fparse(format_footer nic $nhost)
		}
	}
        ^restub inic nic.m
}	