zsh-users
 help / color / mirror / code / Atom feed
* (mime attachment!) debug function: first time weird behavior
@ 1998-02-27 20:58 Timothy J Luoma
  1998-02-27 21:52 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Timothy J Luoma @ 1998-02-27 20:58 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

[An attachment was originally included here]

I have attached a function which I have been working on.

It archives information gathered from 'whois' (so I don't have to wait for  
internic to respond if I have already run 'whois' on the archive.

The first time it is run it says:

/usr/local/lib/whois/ is a directory
 whois: Have info archived: /usr/local/lib/whois/

If I run it again, it works fine.

I am totally clueless as to why this is happening but it is easily reproducable.

Any help greatly appreciated.

TjL

ps -- the file has long lines, which is why I didn't just paste it

[-- Attachment #2.1: openfiletmp000595 --]
[-- Type: application/octet-stream, Size: 1115 bytes --]

whois () {
	unsetopt ALL_EXPORT
	DIR=/usr/local/lib/whois 
	FILE=$DIR/$LOOKFOR 
	LOOKFOR=`echo $* | awk '{print $NF}'` 
	NAME="whois" 
	SERVERS=(rs.internic.net whois.arin.net whois.ripe.net whois.apnic.net whois.nic.mil) 
	TMP=/tmp/$NAME.$$ 
	WHOIS=/usr/ucb/whois 
	if [ -r $FILE ]
	then
		less $FILE
		echo " $NAME: Have info archived: $FILE\n"
	else
		FOUND=no 
		for i in $SERVERS
		do
			if [ "$FOUND" = "no" ]
			then
				/bin/rm -rf $TMP && $WHOIS -h "$i" $LOOKFOR | sed -n -e "/If you would like to search on arbitrary/q" -ep | sed -n -e "/The ARIN Registration Services Host/q" -ep | sed -n -e "/The InterNIC Registration Services Host/q" -ep | sed -n -e "/only contains DOD Information/q" -ep 2>& 1 > $TMP
				case $i in
					whois.ripe.net|whois.apnic.net) NOMATCH='No entries found'  ;;
					*) NOMATCH='No match for'  ;;
				esac
				fgrep -q -s "$NOMATCH" $TMP
				if [ "$?" = "1" ]
				then
					FOUND=yes 
					less $TMP
					echo "\n INFO obtained `date` from $i\n" >> $TMP
					command mv --interactive --verbose $TMP $FILE
				else
					echo "$i does not know $LOOKFOR"
				fi
			fi
		done
	fi
}

[-- Attachment #2.2: Type: text/enriched, Size: 566 bytes --]




I have attached a function which I have been working on.


It archives information gathered from 'whois' (so I don't have to wait for
internic to respond if I have already run 'whois' on the archive.

<nofill>
The first time it is run it says:

/usr/local/lib/whois/ is a directory
 whois: Have info archived: /usr/local/lib/whois/

If I run it again, it works fine.

I am totally clueless as to why this is happening but it is easily reproducable.

Any help greatly appreciated.

TjL

ps -- the file has long lines, which is why I didn't just paste it 
</nofill>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-02-28  1:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-27 20:58 (mime attachment!) debug function: first time weird behavior Timothy J Luoma
1998-02-27 21:52 ` Bart Schaefer
1998-02-28  1:10   ` Timothy J Luoma

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).