bin@primate.wisc.edu (Brain in Neutral) (01/04/91)
Possibly this will be of use to somebody. Given tech note numbers,
this shell script runs off to sumex and gets them for you.
E.g.,
fetchtn 97 184 3
gets tn-003.hqx, tn-097.hqx and tn-184.hqx for you.
Clip off the trash and run through sh to unpack. Then make it executable
with chmod.
# This is a shell archive.
# Remove everything above and including the cut line.
# Then run the rest of the file through sh.
-----cut here-----cut here-----cut here-----cut here-----
#!/bin/sh
# shar: Shell Archiver
# Run the following text with /bin/sh to create:
# fetchtn
# This archive created: Thu Jan 3 11:59:18 1991
echo shar: extracting fetchtn '(824 characters)'
sed 's/^XX//' << \SHAR_EOF > fetchtn
XX#!/bin/sh
XX
XX# fetchtn
XX
XX# Badly-written shell script to automatically fetch Macintosh
XX# tech notes from sumex.
XX
XX# Syntax: fetchtn number ...
XX
XX# Examples:
XX# fetchtn 3 102 get notes 003 and 102
XX
XX# Assumptions:
XX# Technotes are stored in ~ftp/info-mac/apple/tn/tn-???.hqx, where
XX# the note number is always 3 digits long.
XX
XX# The host contacted is sumex-aim.stanford.edu. Can be changed below.
XX
XX# 11 Dec 90 Paul DuBois dubois@primate.wisc.edu
XX
XX# 11 Dec 90 V1.0.
XX
XXif [ $# -lt 1 ]; then
XX echo "Usage: fetchtn number"
XX exit 1
XXfi
XX
XX
XX# host is the host to contact
XX
XXhost=sumex-aim.stanford.edu
XX
XX(
XX echo user anonymous $USER
XX echo cd 'info-mac/apple/tn'
XX for n do
XX # pad short numbers to three digits long
XX case "$n" in
XX ?)
XX n=00$n
XX ;;
XX ??)
XX n=0$n
XX ;;
XX esac
XX echo get tn-${n}.hqx
XX done
XX echo bye
XX) | ftp -n -v $host
SHAR_EOF
if test 824 -ne "`wc -c fetchtn`"
then
echo shar: error transmitting fetchtn '(should have been 824 characters)'
fi
# End of shell archive
exit 0
--
Paul DuBois
dubois@primate.wisc.edu