allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (06/04/89)
Posting-number: Volume 7, Issue 16 Submitted-by: seg@smsdpg.UUCP (Scott Garfinkle) Archive-name: uunet [Semi-automated UUCP retrieval of files from uunet's archives. ++bsa] I have no idea whether this stuff "deserves" further distribution, but I thought I'd send you a couple of csh script that make accessing uunet easier. I hope that someone can use them. yours, scott g. #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The shar that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # If this archive is complete, you will see the following message at the end: # "End of archive 1 (of 1)." # Contents: get_files squashls # Wrapped by seg@smsdpg on Wed May 31 09:44:24 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'get_files' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'get_files'\" else echo shar: Extracting \"'get_files'\" \(661 characters\) sed "s/^X//" >'get_files' <<'END_OF_FILE' X#!/bin/csh -f X# get_files - by Scott E. Garfinkle (seg@smsdpg.uu.net) X# create and execute uucp commands based on extract from uunet's ls-lR Xif($#argv == 1) then X set fn=$1 Xelse X set fn=want Xendif Xset tfile=temp.$$ Xset tfile2=temp2.$$ Xcat > $tfile << 'XX' # sed script X/^$/d X/:$/s// :/ X/^d/d Xs/^-.*198[6789] // Xs/^-.*[0-5][0-9] // X'XX' Xcat > $tfile2 << 'XX' # awk script X$0 ~ /.*:/ { prefix = $1 } X$0 !~ /.*:/ { printf "%s/%s\n", prefix, $0 } X'XX' Xsed -f $tfile < $fn | awk -f $tfile2 | \ X sed 's;/usr/spool/ftp\(.*\);uucp -d uunet\!\\~uucp\1 ~uucp\1;' | \ X (echo "Executing following commands:" > /dev/tty; tee /dev/tty) | \ X sh -s Xrm $tfile $tfile2 END_OF_FILE echo shar: NEWLINE appended to \"'get_files'\" if test 662 -ne `wc -c <'get_files'`; then echo shar: \"'get_files'\" unpacked with wrong size! fi chmod +x 'get_files' # end of 'get_files' fi if test -f 'squashls' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'squashls'\" else echo shar: Extracting \"'squashls'\" \(476 characters\) sed "s/^X//" >'squashls' <<'END_OF_FILE' X#!/bin/csh -f X# squasls - by Scott E. Garfinkle (seg@smsdpg.uu.net) X# masssage ls-lR[.Z] files from uunet into a more manageable format. Xif(-e ls-lR.Z) uncompress ls-lR Xif(! -e ls-lR) then X echo this program uncompresses and massages ls-lR.Z -- none present X exit 1 Xendif Xex - ls-lR <<'XX' >& /dev/null Xg/^$/d Xg/^d/d Xg/^total/d Xg/unreadable/d X1 X/\/usr\/spool\/ftp\/faces/ X/^\//ka X$ X?\/faces\/? X/^\//kb X'a,'bw! faces.list X'a,'bd Xw Xq X'XX' Xrm -f faces.list.Z Xcompress faces.list END_OF_FILE echo shar: NEWLINE appended to \"'squashls'\" if test 477 -ne `wc -c <'squashls'`; then echo shar: \"'squashls'\" unpacked with wrong size! fi chmod +x 'squashls' # end of 'squashls' fi echo shar: End of archive 1 \(of 1\). cp /dev/null ark1isdone MISSING="" for I in 1 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have the archive. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0