HP-UX Reference (11i v1 05/09) - 1 User Commands N-Z (vol 2)

s
shar(1) shar(1)
-o Preserve user and group ownership on files and directories.
-r Cause the archive to contain code requiring that the user unpacking it be
root. This is
useful for processing system archives.
-s Perform error checking using
sum (see sum(1)). Both -c and -s can be specified for better
error checking. Also see WARNINGS below.
-t Write diagnostics and messages directly to your terminal instead of to the standard error.
This is useful when invoking
shar from programs (such as
vi that normally combine stan-
dard error with standard output. Specifying
-t
also invokes the -v (verbose) option.
-u Assume that the remote site has
uudecode for unpacking. If this option is not specified,
a version of
uudecode is sent and compiled if any non-ASCII files are archived.
-v Announce archived file names as they are packed. The
-t option determines the destina-
tion for these announcements.
-Z Compress files using compress
(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:
cd; shar -cmos .
or
shar -cmos $HOME
To preserve your /dev directory, type:
shar -mor /dev >save_dev_files
To send your newest programs in directory newstuff in your home directory to a friend, type:
cd; shar -cmos newstuff | mailx -s ’new source’ friend
RETURN VALUE
shar returns zero if successful; nonzero if problems with arguments occur.
DIAGNOSTICS
If the -b option is specified, shar 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 contents.
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 system and the mailer is configured to
expand tabs (by default or otherwise), any file in the archive will be modified if it contains tabs. If the -c
or -s 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
shar was invented in the public domain. This version of shar was developed by HP.
FILES
/dev/tty
$TMPDIR/unpack*
For unpacking non-ASCII files if TMPDIR environment variable is set and the
directory specified in it is accessible.
/var/tmp/unpack* For unpacking non-ASCII files if TMPDIR environment variable is not set or
the directory specified in it is not accessible and /var/tmp directory is
Section 1920 Hewlett-Packard Company 2 HP-UX 11i Version 1: September 2005