From: Timothy J Luoma <luomat+Lists/Zsh/users@luomat.peak.org>
To: zsh-users@math.gatech.edu
Subject: (mime attachment!) debug function: first time weird behavior
Date: Fri, 27 Feb 98 15:58:40 -0500 [thread overview]
Message-ID: <199802272058.PAA00696@luomat.peak.org> (raw)
[-- 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>
next reply other threads:[~1998-02-27 21:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-27 20:58 Timothy J Luoma [this message]
1998-02-27 21:52 ` Bart Schaefer
1998-02-28 1:10 ` Timothy J Luoma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199802272058.PAA00696@luomat.peak.org \
--to=luomat+lists/zsh/users@luomat.peak.org \
--cc=zsh-users@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).