If you have a program that consists of more than one file then the shar command can provide a way for you to e-mail the program as one single message. When your source code is all ready to turn in by e-mail, do commands such as these:

jlee@vega: shar deq.h deq.cpp driver.cpp testScript > mysource.shar
jlee@vega: mail -s "CS2500,prog4.fin" < mysource.shar

The shar command above "packs up" all the files comprising the program (deq.h, deq.cpp, driver.cpp, and testScript) into one shell archive file called mysource.shar. The mail command above then sends the shar file called mysource.shar to with the subject line "CS2500,prog4.fin" affixed to the message. John can save this single e-mail message. It is then a simple matter for John to delete the mail header lines from the saved message and "unpack" all the source files by doing the command:

john@ishi: /bin/sh mysource.shar

After the command above has executed, John has copies of deq.h, deq.cpp, driver.cpp, and testScript in his current directory.

He can then immediately compile and test the program.

Shar is a big time-saver for both the sender and the receiver.

The student sending the files has only to execute a shar command and mail a single file instead of mailing numerous files individually.

Instead of having to save each file individually, and individually edit out the mailer headers from each file, the recipient has only to save a single message, edit headers out of one file and run a single command to unbundle the files.