Next: , Previous: shar xmit-defenses, Up: shar Invocation


2.1.7 shar-flavors options

Producing different kinds of shars:.

vanilla-operation option (-V).

This is the “produce very simple shars” option. This option produces ‘vanilla’ shars which rely only upon the existence of echo, test and sed in the unpacking environment.

It changes the default behavior from mixed mode (--mixed-uuencode) to text mode (--text-files). Warnings are produced if options are specified that will require decompression or decoding in the unpacking environment.

no-piping option (-P).

This is the “use temporary files between programs” option. In the shar file, use a temporary file to hold file contents between unpacking stages instead of using pipes. This option is mandatory when you know the unpacking will happen on systems that do not support pipes.

no-check-existing option (-x).

This is the “blindly overwrite existing files” option. Create the archive so that when processed it will overwrite existing files without checking first. If neither this option nor the --query-user option is specified, the unpack will not overwrite pre-existing files. In all cases, however, if --cut-mark is passed as a parameter to the script when unpacking, then existing files will be overwritten unconditionally.

    sh shar-archive-file -c
query-user option (-X).

This is the “ask user before overwriting files” option.

This option has some usage constraints. It:

When unpacking, interactively ask the user if files should be overwritten. Do not use for shars submitted to the net.

Use of this option produces shars which will cause problems with some unshar-style procedures, particularily when used together with vanilla mode (--vanilla-operation). Use this feature mainly for archives to be passed among agreeable parties. Certainly, -X is not for shell archives which are to be submitted to Usenet or other public networks.

The problem is that unshar programs or procedures often feed /bin/sh from its standard input, thus putting /bin/sh and the shell archive script in competition for input lines. As an attempt to alleviate this problem, shar will try to detect if /dev/tty exists at the receiving site and will use it to read user replies. But this does not work in all cases, it may happen that the receiving user will have to avoid using unshar programs or procedures, and call /bin/sh directly. In vanilla mode, using /dev/tty is not even attempted.

no-timestamp option (-m).

This is the “do not restore modification times” option. Avoid generating 'touch' commands to restore the file modification dates when unpacking files from the archive.

When file modification times are not preserved, project build programs like "make" will see built files older than the files they get built from. This is why, when this option is not used, a special effort is made to restore timestamps.

quiet-unshar option (-Q).

This is the “avoid verbose messages at unshar time” option. Verbose OFF. Disables the inclusion of comments to be output when the archive is unpacked.

basename option (-f).

This is the “restore in one directory, despite hierarchy” option. Restore by the base file name 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 this option is specified or not.