Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!apple!agate!stew.ssl.berkeley.edu!ericco From: ericco@stew.ssl.berkeley.edu (Eric C. Olson) Newsgroups: comp.sys.atari.st Subject: Re: Proposed change to names of sources/binaries postings Message-ID: <1990Apr14.200949.11149@agate.berkeley.edu> Date: 14 Apr 90 20:09:49 GMT References: <1588@male.EBay.Sun.COM> Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Organization: University of California, Berkeley Lines: 106 Steven Grimm writes: >Personally, I'd like to see Dumas uud hacked to take multiple filenames >on the command line instead, but it's no problem for me to use the proposed >filenames if people prefer that. Here's two scripts that I use to extract and assemble uuencode articles. This comes as is ... as for documentation UTSL (use the source luke)! I pipe articles from Rn directly into uupart. Later, a assemble the parts with muu. This works for me because I never get anything in the right order. BTW, this is just a hack that happens to work on every file I've tried it on. Eric ----- uupart ----- #!/bin/sh # save uuencode parts in the right place uufilename () { awk '($1 == "begin"){if ($2 == "part") print $4; else print $3}' $1 } strip () { awk ' ($1 == "begin" || $1 == "table") {flag = 1} {if (flag == 1) print} ($1 == "include" || $1 == "end") {flag = 0} ' <$1 >$2 } T=/tmp/uupart.$$ trap "rm -f $T*; exit 0" 0 1 2 3 15 cat - >$T strip $T `uufilename $T` ----- muu ----- #!/bin/sh # combine multiple uuencoded files uuoutput () { awk '($1 == "begin" && $2 != "part") {print $3}' $1 } nextfile () { awk ' ($1 == "include") {print $2; exit} ' <$1 } body () { awk ' ($1 == "include") {flag = 0} {if (flag == 1) print} ($1 == "end") {flag = 0} ($1 == "begin") {flag = 1} ' <$1 >$2 } header () { awk ' ($1 == "table") {flag = 1} ($1 == "begin") {print "begin 777 "$3; exit} {if (flag == 1) print} ' <$1 >$2 } T=/tmp/muu.$$ trap "rm -f $T*; exit 0" 0 1 2 3 15 NEXT=${1?"requires name of first part"} DIR=`expr $NEXT : '\(.*\)/.*' \| '.'` NEXT=`expr //$NEXT : '.*/\(.*\)'` OUT=`uuoutput $DIR/$NEXT` if test ! "$OUT"; then echo "$NEXT doesn't contain the output file name" exit 1 fi header $DIR/$NEXT $T.uu while test $NEXT do echo processing $DIR/$NEXT body $DIR/$NEXT $T cat $T >>$T.uu NEXT=`nextfile $DIR/$NEXT` done uudecode $T.uu Eric ericco@ssl.berkeley.edu