Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site telesoft.UUCP Path: utzoo!linus!decvax!tektronix!hplabs!sdcrdcf!sdcsvax!telesoft!pilotti From: pilotti@telesoft.UUCP (Keith Pilotti @shine) Newsgroups: net.sources Subject: Re: leading comments Message-ID: <178@telesoft.UUCP> Date: Thu, 29-Aug-85 08:46:02 EDT Article-I.D.: telesoft.178 Posted: Thu Aug 29 08:46:02 1985 Date-Received: Mon, 2-Sep-85 08:57:16 EDT References: <318@luke.UUCP> <6589@boring.UUCP> Reply-To: pilotti@telesoft.UUCP (Keith Pilotti @shine) Distribution: net Organization: TeleSoft, SanDiego CA Lines: 63 Summary: A better unshar? In article <6589@boring.UUCP> ken@mcvax.UUCP (Amoeba #117) writes: >In article <318@luke.UUCP> itkin@luke.UUCP (Steven List) writes: >>I'd like to suggest that when we put some commentary at the beginning, >>each line be preceded by the shell comment character (#). > >This is a repost of a shell script that will solve the problem if every >shar'ed source has a line beginning with # at the top of the archive. >From rn I just have to say: "| (cd sourcedir; unshar)". > Starting from Ken's great idea, I fixed up this script which adds: o Support for multiple file names (eg. "unshar *" for multi-shar postings.) o Support for shell archives which begin with a ":" (old `unshar' barfs heavily...) *** REPLACE YOUR `unshar' WITH THIS ONE *** (ie. "|(cd ~/bin;unshar)" :-) /+\ Keith ________________________________________________________ KEITH F. PILOTTI -- TeleSoft (619) 457-2700 x172 10639 Roselle St, SanDiego, CA 92121 ...{decvax,ucbvax}!sdcsvax!telesoft!pilotti #! /bin/sh cat > unshar << '@END@' #! /bin/sh # $Header: RCS/unshar,v 1.1 85/08/27 pilotti Exp $ # # unshar - pipe shar part of input through sh # # Ignore lines before the first # "#" or ":" comment starting in the first column. # Input is either $@ (ie. arg list) or stdin. # # NOTE: Non-BSD sites -- ln /bin/test /bin/[ # if [ "$*" = "" ] then set - \- fi for shar do if [ "$shar" = "-" ] then shar="" echo Unsharing standard-input else echo Unsharing $shar fi sed -n '/^[#:]/,$ p' ${shar-} | sh done @END@ chmod +x unshar exit