Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: notesfiles
Path: utzoo!watmath!clyde!cbosgd!ihnp4!zehntel!dual!qantel!intelca!hplabs!hp-pcd!hpcnoe!dat
From: dat@hpcnoe.UUCP (dat)
Newsgroups: net.sources
Subject: shell script to generate shar files
Message-ID: <20500004@hpcnoe.UUCP>
Date: Sat, 8-Dec-84 02:51:00 EST
Article-I.D.: hpcnoe.20500004
Posted: Sat Dec  8 02:51:00 1984
Date-Received: Tue, 11-Dec-84 07:40:20 EST
Organization: Hewlett-Packard - Fort Collins, CO
Lines: 56
Nf-ID: #N:hpcnoe:20500004:000:1412
Nf-From: hpcnoe!dat    Dec  7 23:51:00 1984



	By popular demand, herein is enclosed a bourne shell 
script that will produce a shell-archive format file of all
the files in the users current directory when executed.  Usage
is quite simple: save this file to 'shar', chmod +x shar and
then shar .  It does the rest!

	(Hopefully this will result in more stuff being submitted
to the net!)

					Dave Taylor
					Colorado Networks Operation

				..hpfcla!hpcnoe!dat

or, my own machine:		..hpfcla!hpcnoe!veeger!eunich!dat

------------------- cut, as they say, here -----------------


# sh script generates a shell archive containing all files in the
#    current directory.  It uses /tmp/$1 as a temporary output file
#    then moves that file to $1...
#
# Note that if the first character of this file is NOT a hash
# symbol (#) this script will ALSO work under the csh shell!!
# (check the manual if you don't believe me!)
#

if [ $# -lt 1 ] 
 then
  echo Usage: $0 \
  exit 1
 fi

rm -f /tmp/$1 $1

for file in * 
{
  echo Archiving file $file
  echo "# -------- $file --------" >> /tmp/$1
  echo "echo extracting file $file" >> /tmp/$1
  echo "cat \<\< THE_END \> $file" >> /tmp/$1
  cat $file >> /tmp/$1
  echo "THE_END" >> /tmp/$1
}

echo echo Done with extraction >> /tmp/$1

mv /tmp/$1 $1

echo Done

# ---------- cut this line out if you want to, too! 
# ---------- This is actually the last line of the file!