shar(1)shar(1)NAMEshar - make a shell archive package
SYNOPSIS
[options] [file|dir] ... package
DESCRIPTION
The command bundles the named files and directories into a single dis‐
tribution package suitable for mailing or moving. The files can con‐
tain any data, including executables. The resulting package, written
to standard output, is a shell script file that can be edited (to add
messages at the beginning, etc.).
To unpack package, use the command with the package name as an argument
as follows:
When unpacking, the files and directories in package are written to the
path names recorded in the archive.
If a directory is specified and the option is not given, all files
beneath that directory are archived.
If a special file is specified, the appropriate commands are emitted to
recreate the file (see mknod(1M)).
protects the contained files from mail processing, if necessary, by
inserting an @ character at the beginning of each line. If the file
contains unusual data, the data is transformed into format, and a
script is included in package so that the package can still be unpacked
correctly by See WARNINGS for more information about mailers and file
modifications.
Access modes are preserved for both directories and files.
Options
recognizes the following options:
Assume that files can be shipped, regardless of their
contents; do not protect them specially. is conserva‐
tive, and might decide to a file containing special
characters (such as Ctrl-G) that the user knows do not
need protection.
Suppress warning messages regarding optional access control list
entries. does not archive optional access control
list entries in a file's access control list (see
acl(5)). Normally, a warning message is printed for
each file having optional access control list entries.
Archive files under their base names,
regardless of the original path names specified. The
contents are thus unpacked into the current directory
instead of to the originally specified path names.
This allows you to archive files from many directories
but unpack them into a single directory. It also
allows you to unpack, for example, into instead of
overwriting the original one in
Append to the package a simple data-integrity check using
to ensure that the contents were not damaged in tran‐
sit (see wc(1)). This check is performed automati‐
cally after unpacking. Also see WARNINGS below.
Insert a line of the form
before the archive.
If a directory is specified, do not transmit its contents,
but rather only create the empty directory.
Cause the archive to contain code that notifies the user if
his or her current directory is not the same as dir,
which must be an absolute path. If the user is not in
dir, the unpacking can be continued by responding to
the archive's question.
Cause the archive to contain code that prevents
from unpacking files that would overwrite existing
files.
Read a list of file names from
file and archive those files as if they were given as
arguments.
Follow symbolic links as if they were normal files or directo‐
ries.
If this option is not specified, archives the link.
Retain modification and access times on files when they are
unpacked.
Preserve user and group ownership on files and directories.
Cause the archive to contain code
requiring that the user unpacking it be This is useful
for processing system archives.
Perform error checking using
(see sum(1)). Both and can be specified for better
error checking. Also see WARNINGS below.
Write diagnostics and messages directly to your terminal
instead of to the standard error. This is useful when
invoking from programs (such as that normally combine
standard error with standard output. Specifying also
invokes the (verbose) option.
Assume that the remote site has
for unpacking. If this option is not specified, a
version of is sent and compiled if any non-ASCII files
are archived.
Announce archived file names as they are packed.
The option determines the destination for these
announcements.
Compress files using
(see compress(1)).
Most options are flagged in the header of the resulting package,
thereby recording the format of the archive. The name of the archiver,
system, and time/date of the archive are also recorded in the header.
EXAMPLES
To archive all files under your home directory, type:
or
To preserve your directory, type:
To send your newest programs in directory in your home directory to a
friend, type:
RETURN VALUE
returns zero if successful; nonzero if problems with arguments occur.
DIAGNOSTICS
If the option is specified, refuses to archive directories.
WARNINGS
The modification and access time restoration does not take time zones
into account.
Files with newline characters in their names scramble the table of con‐
tents.
Non-ASCII files with white space in their names do not unpack.
If a mailer such as elm(1) is used to transfer package to another sys‐
tem and the mailer is configured to expand tabs (by default or other‐
wise), any file in the archive will be modified if it contains tabs.
If the or option is used to create the archive, the data-integrity
check will fail during unpacking of any files in package that contain
tab characters that were converted to spaces. (Some mailers that
expand tabs when transferring files over a network may or may not
expand tabs when transferring files to the sender or other users on the
local system.) If an editor is used to modify any of the files in
package, the data-integrity check will also fail for the files that
were changed.
AUTHOR
was invented in the public domain. This version of was developed by
HP.
FILES
For unpacking non-ASCII files if
environment variable is set and the directory specified in it is
accessible.
For unpacking non-ASCII files if
environment variable is not set or the directory specified in it
is not accessible and directory is accessible.
For unpacking non-ASCII files if
environment variable is not set or the directory specified in it
is not accessible and directory is not accessible.
For uncompressing files, which are
packed using option, if environment variable is set and the
directory specified in it is accessible.
For uncompressing files, which are
packed using option, if environment variable is not set or the
directory specified in it is not accessible and directory is
accessible.
For uncompressing files, which are
packed using option, if environment variable is not set or the
directory specified in it is not accessible and directory is not
accessible.
SEE ALSOar(1), compress(1), cpio(1), find(1), tar(1), acl(5).
shar(1)