shar
program
The format of the shar
command is one of:
shar [ option ] ... file ... shar -S [ option ] ...
In the first form, the file list is given as command arguments. In the
second form, the file list is read from standard input. The resulting
archive is sent to standard output unless the -o
option is given.
Options can be given in any order. Some options depend on each other:
the -o
option is required if the -l
or -L
option
is used. The -n
option is required if the -a
option
is used. Also see -V
below.
Some options are special purpose:
--help
--version
-q
--quiet
shar
time. Messages are usually issued
on standard error to let the user follow the progress, while making
the archives. This option inhibits these messages.
-p
--intermix-type
-M
, -B
,
-T
, -z
and -Z
may be embedded, and files to
the right of the option will be processed in the specified mode.
Without the -p
option, embedded options would be interpreted
as file names. See section Selecting how files are stocked for more information on these options.
-S
--stdin-file-list
find . -type f -print | shar -S -o /tmp/big.sharIf
-p
is specified on the command line, then the options
-M
, -B
, -T
, -z
and -Z
may be
included in the standard input (on a line separate from file names).
The maximum number of lines of standard input, file names and options,
may not exceed 1024.
-o prefix
--output-prefix=prefix
-l
or the -L
switches
are used.
When prefix contains any `%' character, prefix is then
interpreted as a sprintf
format, which should be able to display
a single decimal number. When prefix does not contain such a
`%' character, the string `.%02d' is internally appended.
-l size
--whole-size-limit=size
-L size
--split-size-limit=size
unshar
, used with option -e
, to unpack them
all at once. See section Invoking the unshar
program.
For people used to saving all the shell archives into a single mail
folder, care must be taken to save them in the appropriate order.
For those having the appropriate tools (like Masanobu Umeda's
rmailsort
package for GNU Emacs), shell archives can be saved
in any order, then sorted by increasing date (or send time) before
massive unpacking.
-n name
--archive-name=name
-a
switch further down.
-s address
--submitter=address
-s
option allows for overriding the email address for the
submitter, for when the default is not appropriate. The automatically
determined address looks like `username@hostname'.
-a
--net-headers
Submitted-by: address Archive-name: name/partnnThe name must be given with the
-n
switch. If name
includes a `/', then `/part' isn't used. Thus
`-n xyzzy' produces:
xyzzy/part01 xyzzy/part02while `-n xyzzy/patch' produces:
xyzzy/patch01 xyzzy/patch02and `-n xyzzy/patch01.' produces:
xyzzy/patch01.01 xyzzy/patch01.02
-c
--cut-mark
-T
--text-files
-B
--uuencode
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, because
people like to readily see, by mere inspection of a shell archive,
what it is about.
-M
--mixed-uuencode
-z
--gzip
gzip
and uuencode
on all files prior to packing.
The recipient must have uudecode
and gzip
(used with
-d
) in order to unpack.
Usage of -z
in net shars will cause you to be flamed off
the earth.
-g level
--level-for-gzip=level
-level
as a parameter to
gzip
. The -g
option turns on the -z
option
by default. The default value is 9, that is, maximum compression.
-Z
--compress
compress
and uuencode
on all files prior to packing.
The recipient must have uudecode
and compress
(used
with -d
) in order to unpack. Option -C
is a synonymous
for -Z
, but is deprecated.
Usage of -Z
in net shars will cause you to be flamed off
the earth.
-b bits
--bits-per-code=bits
-bx
as a parameter to
compress
. The -B
option turns on the -Z
option by default. The default value is 12, foreseeing the memory
limitations of some compress
programs on smallish systems, at
unshar
time.
-w
--no-character-count
-F
--force-prefix
-B
or -Z
is used. Normally, the prefix character
is `X'. If the parameter to the -d
option starts with
`X', then the prefix character becomes `Y'.
-d string
--here-delimiter=string
-V
--vanilla-operation
echo
, test
and sed
in the unpacking
environment.
The -V
disables options offensive to the network cop
(or brown shirt). It also changes the default from mixed mode
-M
to text mode -T
. Warnings are produced if option
-B
, -z
, -Z
, -p
or -M
is specified
(any of which does or might require uudecode
, gzip
or
compress
in the unpacking environment).
-P
--no-piping
uudecode
, instead of using pipes. This option is mandatory
when you know the unpacking uudecode
is unwilling to merely
read its standard input. Richard Marks wrote what is certainly the
most (in)famous of these, for MSDOS :-).
(Here is a side note from the maintainer. Why isnt't this option
the default? In the past history of shar
, it was decided
that piping was better, surely because it is less demanding on disk
space, and people seem to be happy with this. Besides, I think
that the uudecode
from Richard Marks, on MSDOS, is wrong in
refusing to handle stdin
. So far that I remember, he has
the strong opinion that a program without any parameters should
give its --help
output. Besides that, should I say, his
uuencode
and uudecode
programs are full-featured, one
of the most complete set I ever saw. But Richard will not release
his sources, he wants to stay in control.)
-x
--no-check-existing
-x
nor
-X
is specified, when unpacking itself, the shell archive will
check for and not overwrite existing files (unless -c
is passed
as a parameter to the script when unpacking).
-X
--query-user
-X
produces shars which will cause problems
with some unshar
-style procedures, particularily when used
together with vanilla mode (-V
). 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.
-m
--no-timestamp
touch
commands to restore the file modification
dates when unpacking files from the archive.
When the timestamp relationship is not preserved, some files like
`configure' or `*.info' may be uselessly remade after
unpacking. This is why, when this option is not used, a special
effort is made to restore timestamps,
-Q
--quiet-unshar
unshar
time. Disables the inclusion of
comments to be output when the archive is unpacked.
-f
--basename
shar
, the substructure of that directory will be
restored whether -f
is specified or not.