Creating a Sharfile
The Unix shar utility can be used to create a shell archive (sharfile).
That is, several files are combined into one file in a way that allows
them to be easily separated out into separate files again.
We will use the shar utility to create a single file from several individual
source files for turnin purposes.
E.g., suppose your directory contains these files needed for a program:
main.java class1.java class2.java
You can create a single file containing copies of these files by the
command:
shar main.java class1.java class2.jave > p2.shar
Note that you are "redirecting" the output of the shar utility to
a file named p2.shar. Now you can "turnin" the file p2.shar.
If you are interested in knowing how to unpack a shar file, it is done by the
command:
unshar p2.shar
Any existing files with the same name as one of the ones in the shar
file will be over-written. It is a good testing device to copy your shar
file into an empty work directory, unshar, and test it. That way you will
discover if you forgot to include any files in your shar file.