!Funky!Stuff! echo x - shar cat >shar <<'!Funky!Stuff!' : " from genradb!rob @(#)shar.sh 1.1 2/10/83 " : Run this program by saying sh shar : Here is a simple shell script which will package up a bunch of files : into a "shell archive", which when used as input to a shell, will extract : the constituent files. For example, if I want to : distribute a program consisting of files foo1.c, foo2.c, and makefile, I : would type "shar archive foo1.c foo2.c makefile" and I would then post : "archive" to the net. Recipients would then run the archive into their : shell and would get back the original files. Here it is: : : shar -- Shell archiver AR=$1 shift for i do echo a - $i echo "echo x - $i" >>$AR echo "cat >$i <<'!Funky!Stuff!'" >>$AR cat $i >>$AR echo "!Funky!Stuff!" >>$AR done : : Thanks to James Gosling at CMU for this idea.