news and mail file archiver
Oscar M. Nierstrasz
oscar at utcsrgv.UUCP
Sun Dec 11 05:44:29 AEST 1983
: Here's a shell script that will create a shell script
# for creating shell scripts that will recreate files (whew!).
# That is, run this file under sh to create a shell script
# called mkarc. This file can be used on text files and
# directories to create a shell script that can be mailed
# or posted on the net. That shell script will then
# recreate the argument files, directories and constituent
# files. Of course it won't work for data files or
# object code (use uuencode). The output is similar to
# that used in net.news.map. The following was produced
# by running 'mkarc mkarc'.
echo mkarc
sed 's/^ //' > mkarc << 'All work and no play makes Jack a dull boy'
: mkarc file ...
# Makes a shell script which, when executed, will
# recreate the argument files and directories.
# Recursively includes all directory contents.
# Author: Oscar Nierstrasz (..!utcsrgv!oscar)
for i
do
if test -f $i
then
echo "echo $i"
echo -n "sed 's/^ //' > $i << "
echo "'All work and no play makes Jack a dull boy'"
sed 's/^/ /' < $i
echo "All work and no play makes Jack a dull boy"
elif test -d $i
then
echo "echo $i/"
echo "mkdir $i"
empty=`ls $i`
if test -n "$empty"
then
mkarc $i/*
fi
else
echo "mkarc: cannot find $i" 1>&2
fi
done
All work and no play makes Jack a dull boy
--
UUCP { ihnp4 cornell decwrl watmath uw-beaver ubc-vision sask
garfield qucis linus mcgill-vision }!utcsrgv!oscar
or { allegra decvax duke floyd }!utzoo!utcsrgv!oscar
More information about the Comp.sources.unix
mailing list