The -n option is required if the -a option is used. See -V below.
Print a help summary on standard output, then immediately exits.
Print the version number of the program on standard output, then immediately exits.
-q --quiet --silent
Do not output verbose messages locally when producing the archive.
Allow positional parameter options. The options -B, -T, -z and -Z may be embedded, and files to the right of the option will be processed in the specified mode.
Read list of files to be packed from the standard input rather than from the command line. Input must be in a form similar to that generated by the find command, one filename per line. This switch is especially useful when the command line will not hold the list of files to be packed. For example:
find . -type f -print | sort | shar -S -Z -L50 -o /tmp/big If -p is specified on the command line, then the options -B, -T, -z and -Z may be included in the standard input (on a line separate from filenames). The maximum number of lines of standard input, file names and options, may not exceed 1024.
-o XXX --output-prefix=XXX
Save the archive to files XXX.01 thru XXX.nn instead of sending it to standard out. Must be used when the -l or the -L switches are used.
-l XX --whole-size-limit=XX
Limit the output file size to XXk bytes but don't split input files.
-L XX --split-size-limit=XX
Limit output file size to XXk bytes and split files if necessary. The archive parts created with this option must be unpacked in correct order.
Controlling the shar headers:
-n name --archive-name=name
Name of archive to be included in the header of the shar files. See the -a switch.
-s who@where --submitter=who@where
Override automatically determined submitter name.
Archive-name: The -n switch. If name includes a '/'
The who@where can be explicitly stated with the -s switch if the default isn't appropriate. Who@where is essentially built as `whoami`@`uname`.
Start the shar with a cut line. A line saying 'Cut here' is placed at the start of each output file.
Selecting how files are stocked:
Mixed mode. Determine if the files are text or binary and archive correctly (default). Files found to be binary are uudecoded prior to packing (USE OF UUENCODE IS NOT APPRECIATED BY MANY ON THE NET).
Treat all files as text.
Treat all files as binary, use uuencode prior to packing. This increases the size of the archive. The recipient must have uudecode in order to unpack. (USE OF UUENCODE IS NOT APPRECIATED BY MANY ON THE NET).
Gzip and uuencode all files prior to packing. The recipient must have uudecode and gzip in order to unpack (USE OF UUENCODE AND GZIP IS NOT APPRECIATED BY MANY ON THE NET).
-g LEVEL --level-for-gzip=LEVEL
When doing compression, use '-LEVEL' as a parameter to gzip. Default is 9. The -g option turns on the -z option by default.
Compress and uuencode all files prior to packing. The recipient must have uudecode and compress in order to unpack (USE OF UUENCODE AND COMPRESS IS NOT APPRECIATED BY MANY ON THE NET). Option -C is synonymous to -Z, but is being deprecated.
-b BITS --bits-per-code=BITS
When doing compression, use '-bBITS' as a parameter to compress. The -B option turns on the -Z option by default. Default value is 12.
Protecting against transmission errors:
Do NOT check each file with 'wc -c' after unpack. The default is to check.
Do NOT use 'md5sum' digest to verify the unpacked files. The default is to check.
Forces the prefix character (normally 'X' unless the parameter to the -d option starts with 'X') to be prepended to every line even if not required. This option may slightly increase the size of the archive, especially if -B or -Z is used.
-d XXX --here-delimiter=XXX
Use XXX to delimit the files in the shar instead of SHAR_EOF. This is for those who want to personalize their shar files.
Producing different kinds of shars:
disables options offensive to the -B, -z, -Z, -p or -M (any of which does or might require uudecode, gzip or compress in the unsharing environment).
Use temporary files instead of pipes in the shar file.
Overwrite existing files without checking. If neither -x nor -X is specified, the unpack will check for and not overwrite existing files when unpacking the archive. If -c is passed as a parameter to the script when unpacking:
sh archive -c
then existing files will be overwritten unconditionally.
When unpacking, interactively ask the user if files should be overwritten. (DO NOT USE FOR SHARS SUBMITTED TO THE NET).
Avoid generating 'touch' commands to restore the file modification dates when unpacking files from the archive.
Verbose OFF. Disables the inclusion of comments to be output when the archive is unpacked.
Restore by filename only, rather than path. This option causes only file names to be used, which is useful when building a shar from several directories, or another directory. Note that if a directory name is passed to shar, the substructure of that directory will be restored whether -f is specified or not.
Do not produce internationalized shell archives, use default english messages. By default, shar produces archives that will try to output messages in the unpackers preferred language (as determined by the LANG/LC_MESSAGES environmental variables) when they are unpacked. If no message file for the unpackers language is found at unpack time, messages will be in english.
No chmod or touch is ever generated for directories created when unpacking. Thus, if a directory is given to shar, the protection and modification dates of corresponding unpacked directory may not match those of the original.
If a directory is passed to shar, it may be scanned more than once. Therefore, one should be careful not change the directory while shar is running.
Be careful that the output file(s) are not included in the inputs or shar may loop until the disk fills up. Be particularly careful when a directory is passed to shar that the output files are not in that directory (or a subdirectory of that directory).
Use of the -B, -z or -Z, and especially -M, may slow the archive process considerably, depending on the number of files.