jkh@meepmeep.pcs.com (Jordan K. Hubbard) (09/06/90)
Having used the following for awhile, it suddenly occurred to me that someone else might find it useful. It's exceedingly simple, but does the job. Basically, whenever a new batch of stuff arrives in comp.sources.amiga, my first impulse is to unshar it all, uudecode the binaries and then repack it up as a single, handy (and compressed) zoo file for storage and later transport. The following script does the following automatically: 1. unshar the files (removing the .hdr cruft that unshar leaves behind). 2. decends into the resulting hierarchy looking for .uu files to uudecode. 3. creates a zoo file of the new hierarchy. 4. removes the original shar files and any intermediate dreck. Usage: shtozoo zoo-archive-name .. shar files .. (I.E. shtozoo DKBtrace dkbtrace.sh.*) The zoo-archive-name should be given without the .zoo suffix as it's also used to name the new hierarchy (the files will unpack as zoo-archive-name/..). There. Now the documentation is longer than the script itself! I knew I could do it.. Jordan #!/bin/sh DIR=$1 shift mkdir $DIR cd $DIR for i in $*; do unshar ../$i done rm -f *.hdr ark*isdone UUFILES="`find . -name '*.uu' -print`" if [ "$UUFILES" != "" ]; then for i in $UUFILES; do dirn=`dirname $i` filn=`basename $i` ( cd $dirn; uudecode $filn && rm $filn && echo $dirn/$filn uudecoded automatically ) done fi cd .. rm $* find $DIR -print | zoo aI $DIR.zoo rm -rf $DIR -- PCS Computer Systeme GmbH, Munich, West Germany UUCP: pyramid!pcsbst!jkh jkh@meepmeep.pcs.com EUNET: unido!pcsbst!jkh ARPA: jkh@violet.berkeley.edu or hubbard@decwrl.dec.com