Could we have a standard "shar" file format?
Jeff Glass
jjg at security.UUCP
Mon Sep 16 23:58:11 AEST 1985
In article <396 at persci.UUCP> bill at 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 at mitre-bedford.ARPA (MIL)
{allegra,ihnp4,utzoo,philabs,uw-beaver}!linus!security!jjg (UUCP)
More information about the Comp.sources.bugs
mailing list