makeshar - shell archive shell script
dave
dave at circadia.UUCP
Sun Nov 4 18:51:01 AEST 1984
Here is a copy of my shell archive creation script.
Please, no flames about this kind of thing being posted
before; I`m sure it has, but in the couple of months
I`ve been reading the news, I haven`t seen anything.
In any event it is pretty short.
To run it just type 'sh makeshar files... > output.shar'.
#--------CUT---------CUT---------CUT---------CUT--------#
#########################################################
# #
# This is a shell archive file. To extract files: #
# #
# 1) Make a directory for the files. #
# 2) Write a file, such as "file.shar", containing #
# this archive file into the directory. #
# 3) Type "sh file.shar". Do not use csh. #
# #
#########################################################
#
#
echo Extracting makeshar:
sed 's/^Z//' >makeshar <<\STUNKYFLUFF
Zcat <<XXX
Z#--------CUT---------CUT---------CUT---------CUT--------#
Z#########################################################
Z# #
Z# This is a shell archive file. To extract files: #
Z# #
Z# 1) Make a directory for the files. #
Z# 2) Write a file, such as "file.shar", containing #
Z# this archive file into the directory. #
Z# 3) Type "sh file.shar". Do not use csh. #
Z# #
Z#########################################################
ZXXX
Zfor i in $*
Zdo
Z cat <<XXX
Z#
Z#
Zecho Extracting $i:
Zsed 's/^Z//' >$i <<\\STUNKYFLUFF
ZXXX
Z sed 's/^/Z/' $i
Z set `sum $i`
Z cat <<XXX
ZSTUNKYFLUFF
Zset \`sum $i\`
Zif test $1 != \$1
Zthen
Zecho $i: Checksum error. Is: \$1, should be: $1.
Zfi
ZXXX
Zdone
Zecho echo ALL DONE BUNKY!
Zecho exit 0
STUNKYFLUFF
set `sum makeshar`
if test 54628 != $1
then
echo makeshar: Checksum error. Is: $1, should be: 54628.
fi
echo ALL DONE BUNKY!
exit 0
Dave Messer {ihnp4,stolaf}!umn-cs!circadia!dave
More information about the Comp.sources.unix
mailing list