Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!littlei!reed!omen!caf From: caf@omen.UUCP (Chuck Forsberg WA7KGX) Newsgroups: comp.sources.d Subject: Re: File headers on shar files Message-ID: <622@omen.UUCP> Date: Mon, 7-Dec-87 00:26:15 EST Article-I.D.: omen.622 Posted: Mon Dec 7 00:26:15 1987 Date-Received: Sun, 13-Dec-87 01:47:36 EST References: <393@ddsw1.UUCP> Reply-To: caf@omen.UUCP (Chuck Forsberg WA7KGX) Organization: Omen Technology Inc, Portland Oregon Lines: 47 Keywords: headers, comp.sources, source postings, shars I've found the following shell script able to "crack" most incoming shar bearing news articles. It's called "unr" and from rn it is: "w|unr dir" or "69-77w|unr dir". Everytime a moderator comes up with a new permutation on the shar format I've tweeked unr to keep up with it, and I haven't had any articles that have failed to unpack lately. Of course, the usual caveats about unsharing news articles which might contain nasties still applies. #!/bin/sh # to extract, remove the header and type "sh filename" if `test ! -s ./unr` then echo "Writing ./unr" cat > ./unr << '\Rogue\Monster\' pattern="^[:#]" readme="READ..ME" mkdir $1 cd $1 sed -e '1,/^[:#][ !]/d' -e 's/^chdir /cd /' >/tmp/unrn.$$ ksh /tmp/unrn.$$ sed "/$pattern/q" >$readme pwd;ls -lt|head -15;du case $0 in unr) rm /tmp/unrn.$$ esac exit Notes: Create a temp file minus the initial chatter which tends to bollix shells and unshar programs. "unr" removes the temp file, "unrn" keeps it; unrn is a link to this file called unr. \Rogue\Monster\ else echo "will not over write ./unr" fi if [ `wc -c ./unr | awk '{printf $1}'` -ne 422 ] then echo `wc -c ./unr | awk '{print "Got " $1 ", Expected " 422}'` fi echo "Finished archive 1 of 1" exit Chuck Forsberg WA7KGX Author of YMODEM, ZMODEM, Professional-YAM, ZCOMM, and DSZ ...!tektronix!reed!omen!caf Omen Technology Inc "The High Reliability Software" 17505-V Northwest Sauvie Island Road Portland OR 97231 VOICE:503-621-3406:VOICE TeleGodzilla BBS: 621-3746 19200/2400/1200 CIS:70007,2304 Genie:CAF omen Any ACU 2400 1-503-621-3746 se:--se: link ord: Giznoid in:--in: uucp omen!/usr/spool/uucppublic/FILES lists all uucp-able files, updated hourly