Shar generates scripts that will make directories and plain files. It will not try to generate intermediate filenames, however, so
shar foo/bar/filewill not work. Do
shar foo foo/bar foo/bar/fileinstead.
The script is normally sent to standard output; the ‘‘-o’’ option may be used to specify an output filename. This is designed to prevent filling up the disk if
shar * >SHARcommand is done; do
shar -o SHAR *instead.
The list of files is normally specified on the command line; the ’’-i’’ option may be used instead, to specify a file that contains the list of files to pack up, one per line. If the file name is ‘‘-’’ the standard input is read.
The ‘‘-b’’ option says that all leading directory names should be stripped from the file when they are packed into the archive. For example,
shar -b /etc/termcapcreates an archive that, when executed, creates a file named ‘‘termcap’’ in the current directory, rather than overwrite the host system file. Note, however, that the scripts generated by shar normally refuse to overwrite pre-existing files.
shar: End of archive 3 of 9.at their end.
In addition, each shar will generate a file named arkXisdone. Each script will contain a loop to check for the presence of these files, and indicate to the recipient which archives still need to be executed. The ‘‘-t’’ option may be used to give starting instructions to the recipient. When the scripts determine that all the archives have been unpacked, the text specified with this flag is displayed. For example,
shar -n1 -k9 -t "Now do ’sh ./Configure’" *.c >SHARAdds commands to output the following when all the archives have been unpacked:
You have run all 9 archives. Now do ’sh ./Configure’
Table of Contents