Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/3/84; site security.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!linus!security!jjg
From: jjg@security.UUCP (Jeff Glass)
Newsgroups: net.sources.bugs
Subject: Re: Could we have a standard "shar" file format?
Message-ID: <974@security.UUCP>
Date: Mon, 16-Sep-85 09:58:11 EDT
Article-I.D.: security.974
Posted: Mon Sep 16 09:58:11 1985
Date-Received: Wed, 18-Sep-85 05:32:33 EDT
References: <396@persci.UUCP>
Reply-To: jjg@security.UUCP (Jeff Glass)
Organization: MITRE Corp., Bedford, Ma.
Lines: 23
Summary: 

In article <396@persci.UUCP> bill@persci.UUCP writes:
> I see that yet another "shar" script has been posted to net.sources. I would
> like to see if the net could agree on a standard format for shar files,
> especially for the first line. I use a simple script to extract shar files
> from within postings, but it looks for a line that starts with:
>  #!/bin/sh

If you replace the sed command in your version of unshar with this
sed command, it will be able to recognize shar scripts which begin
with a comment line ( "#" or ":" ) or with a "cut here" line.
It also recognizes a line consisting of "-- " as the beginning of
a signature, and stops the unshar.  sed is an amazing program,
even if it does remind me of assembly language...

sed -n	-e "/^#/b copy" -e "/^:/b copy" \
	-e "/^--*[ 	]*[Cc][Uu][Tt]/b comment" \
	-e d \
	-e :comment -e "s/^./#/" \
	-e :copy -e '/^-- $/q' -e p -e n -e "b copy" \
    ${1-} | /bin/sh
-- 
  security!jjg@mitre-bedford.ARPA				(MIL)
 {allegra,ihnp4,utzoo,philabs,uw-beaver}!linus!security!jjg	(UUCP)