Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsrgv.UUCP Path: utzoo!utcsrgv!oscar From: oscar@utcsrgv.UUCP (Oscar M. Nierstrasz) Newsgroups: net.sources Subject: news and mail file archiver Message-ID: <2914@utcsrgv.UUCP> Date: Sat, 10-Dec-83 14:44:29 EST Article-I.D.: utcsrgv.2914 Posted: Sat Dec 10 14:44:29 1983 Date-Received: Sat, 10-Dec-83 15:31:32 EST Organization: CSRG, University of Toronto Lines: 46 : 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