Next: , Previous: , Up: Top   [Contents]

2 The basic shar utilities

GNU shar makes so-called shell archives out of many files, preparing them for transmission by electronic mail services. A shell archive is a collection of files that can be unpacked by /bin/sh. A wide range of features provide extensive flexibility in manufacturing shars and in specifying shar smartness. For example, shar may compress files, uuencode binary files, split long files and construct multi-part mailings, ensure correct unsharing order, and provide simplistic checksums. See shar Invocation.

GNU unshar scans a set of mail messages looking for the start of shell archives. It will automatically strip off the mail headers and other introductory text. The archive bodies are then unpacked by a copy of the shell. unshar may also process files containing concatenated shell archives. See unshar Invocation.


Next: , Up: Basic   [Contents]

2.1 Invoking shar

If no files are specified, the list of input files is read from standard input. Standard input must not be a terminal. shar creates "shell archives" (or shar files) which are in text format and can be emailed. These files may be unpacked later by executing them with /bin/sh. The resulting archive is sent to standard out unless the -o option is given. A wide range of features provide extensive flexibility in manufacturing shars and in specifying shar "smartness". Archives may be fairly simple (--vanilla-operation) or essentially a mailable tar archive.

Options may be specified in any order until a file argument is recognized. If the --intermix-type option has been specified, more compression and encoding options will be recognized between the file arguments.

Though this program supports uuencode-d files, they are deprecated. If you are emailing files, please consider mime-encoded files. If you do uuencode, base64 is the preferred encoding method.

This section was generated by AutoGen, using the agtexi-cmd template and the option descriptions for the shar program. This software is released under the GNU General Public License, version 3 or later.


Next: , Up: shar Invocation   [Contents]

2.1.1 shar help/usage (--help)

This is the automatically generated usage text for shar.

The text printed is the same whether selected with the help option (--help) or the more-help option (--more-help). more-help will print the usage text by passing it through a pager program. more-help is disabled on platforms without a working fork(2) function. The PAGER environment variable is used to select the program, defaulting to more. Both will exit with a status code of 0.

shar (GNU sharutils) - create a shell archive
Usage:  shar [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [<file>...]

Specify compression:
   -p, --intermix-type        specify compression for input files
                                - prohibits the option 'vanilla-operation'
   -C, --compactor=PROG       specify compaction (compression) program PROG
                                - prohibits the option 'vanilla-operation'
                                - may appear multiple times
                                - it must be known to shar: xz gzip bzip2
   -g, --level-of-compression=LEVEL
                              pass LEVEL for compression
                                - it must be in the range: 1 to 9

Specify file encoding methodology:
   -M, --mixed-uuencode       decide uuencoding for each file
   -B, --uuencode             treat all files as binary
                                - an alternate for mixed-uuencode
   -T, --text-files           treat all files as text
                                - an alternate for mixed-uuencode

Specifying file selection and output modes:
   -o, --output-prefix=str    print output to file PREFIX.nn
   -l, --whole-size-limit=SIZE
                              split archive, not files, to SIZE
                                - requires the option 'output-prefix'
                                - is scalable with a suffix: k/K/m/M/g/G/t/T
                                - it must lie in one of the ranges:
                                  8 to 1023, or 8192 to 4194304
   -L, --split-size-limit=SIZE
                              split archive or files to SIZE
                                - requires the option 'output-prefix'
                                - is scalable with a suffix: k/K/m/M/g/G/t/T
                                - it must lie in one of the ranges:
                                  8 to 1023, or 8192 to 4194304
                                - an alternate for 'whole-size-limit'
   -I, --input-file-list=FILE read file list from FILE

Controlling the shar headers:
   -n, --archive-name=NAME    use NAME to document the archive
   -s, --submitter=NAME       override the submitter name with NAME
   -a, --net-headers          output Submitted-by: & Archive-name: headers
                                - requires the option 'archive-name'
   -c, --cut-mark             start the shar with a cut line
   -t, --translate            translate messages in the script

Protecting against transmission issues:
       --no-character-count   do not use `wc -c' to check size
   -D, --no-md5-digest        do not use md5sum digest to verify
   -F, --force-prefix         apply the prefix character on every line
   -d, --here-delimiter=DELIM use DELIM to delimit the files

Producing different kinds of shars:
   -V, --vanilla-operation    produce very simple shars
   -P, --no-piping            use temporary files between programs
   -x, --no-check-existing    blindly overwrite existing files
   -X, --query-user           ask user before overwriting files
                                - prohibits the option 'vanilla-operation'
   -m, --no-timestamp         do not restore modification times
   -Q, --quiet-unshar         avoid verbose messages at unshar time
   -f, --basename             restore in one directory, despite hierarchy

Internationalization options:
       --no-i18n              do not internationalize
       --print-text-domain-dir  print directory with shar messages

User feedback/entertainment:
   -q, --quiet                do not output verbose messages
       --silent               an alias for the 'quiet' option

Version, usage and configuration options:
   -v, --version[=MODE]       output version information and exit
   -h, --help                 display extended usage information and exit
   -!, --more-help            extended usage information passed thru pager
   -R, --save-opts[=FILE]     save the option state to a config file FILE
   -r, --load-opts=FILE       load options from the config file FILE
                                - disabled with '--no-load-opts'
                                - may appear multiple times

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
If no 'file's are specified, the list of input files is read from a
standard input.  Standard input must not be a terminal.

The following option preset mechanisms are supported:
 - reading file $HOME/.sharrc

'shar' creates "shell archives" (or shar files) which are in text format
and can be emailed.  These files may be unpacked later by executing them
with '/bin/sh'.  The resulting archive is sent to standard out unless the
'-o' option is given.  A wide range of features provide extensive
flexibility in manufacturing shars and in specifying 'shar' "smartness".
Archives may be fairly simple ('--vanilla-operation') or essentially a
mailable 'tar' archive.

Options may be specified in any order until a 'file' argument is
recognized.  If the '--intermix-type' option has been specified, more
compression and encoding options will be recognized between the 'file'
arguments.

Though this program supports 'uuencode'-d files, they are deprecated.  If
you are emailing files, please consider mime-encoded files.  If you do
'uuencode', base64 is the preferred encoding method.

Please send bug reports to:  <bug-gnu-utils@gnu.org>

Next: , Previous: , Up: shar Invocation   [Contents]

2.1.2 compression options

Specifying compression.

intermix-type option (-p).

This is the “specify compression for input files” option.

This option has some usage constraints. It:

Allow positional parameter options. The compression method and encoding method options may be intermixed with file names. Files named after these options will be processed in the specified way.

compactor option (-C).

This is the “specify compaction (compression) program” option. This option takes a string argument PROGRAM.

This option has some usage constraints. It:

The gzip, bzip2 and compress compactor commands may be specified by the program name as the option name, e.g. --gzip. Those options, however, are being deprecated. There is also the xz compactor now. Specify xz with -C xz or --compactor=xz.

Specifying the compactor "‘none’" will disable file compression. Compressed files are never processed as plain text. They are always uuencoded and the recipient must have uudecode to unpack them.

Specifying the compactor compress is deprecated.

level-of-compression option (-g).

This is the “pass level for compression” option. This option takes a number argument LEVEL. Some compression programs allow for a level of compression. The default is 9, but this option allows you to specify something else. This value is used by gzip, bzip2 and xz, but not compress.

bzip2 option (-j).

This is the “bzip2 and uuencode files” option.

This option has some usage constraints. It:

bzip2 compress and uuencode all files prior to packing. The recipient must have uudecode bzip2 in order to unpack.

NOTE: THIS OPTION IS DEPRECATED

gzip option (-z).

This is the “gzip and uuencode files” option.

This option has some usage constraints. It:

gzip compress and uuencode all files prior to packing. The recipient must have uudecode and gzip in order to unpack.

NOTE: THIS OPTION IS DEPRECATED

compress option (-Z).

This is the “compress and uuencode files” option.

This option has some usage constraints. It:

compress and uuencode all files prior to packing. The recipient must have uudecode and compress in order to unpack.

NOTE: THIS OPTION IS DEPRECATED

level-for-gzip option.

This is an alias for the level-of-compression option, see the level-of-compression option documentation.

bits-per-code option (-b).

This is the “pass bits (default 12) to compress” option. This option takes a string argument BITS.

This option has some usage constraints. It:

This is the compression factor used by the compress program.

NOTE: THIS OPTION IS DEPRECATED


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.3 encoding options

Specifying file encoding methodology. Files may be stored in the shar either as plain text or uuencoded. By default, the program selects which by examining the file. You may force the selection for all files. In intermixed option/file mode, this setting may be changed during processing.

mixed-uuencode option (-M).

This is the “decide uuencoding for each file” option.

This option has some usage constraints. It:

Automatically determine if the files are text or binary and archive correctly. Files found to be binary are uuencoded prior to packing. This is the default behavior for shar.

For a file to be considered a text file instead of a binary file, all the following should be true:

  1. The file does not contain any ASCII control character besides BS (backspace), HT (horizontal tab), LF (new line) or FF (form feed).
  2. The file contains no character with its eighth-bit set.
  3. The file contains no line beginning with the five letters "‘from ’", capitalized or not. (Mail handling programs will often gratuitously insert a > character before it.)
  4. The file is either empty or ends with a LF (newline) byte.
  5. No line in the file contains more than 200 characters. For counting purpose, lines are separated by a LF (newline).

uuencode option (-B).

This is the “treat all files as binary” option.

This option has some usage constraints. It:

Use uuencode prior to packing all files. This increases the size of the archive. The recipient must have uudecode in order to unpack. Compressed files are always encoded.

text-files option (-T).

This is the “treat all files as text” option.

This option has some usage constraints. It:

If you have files with non-ascii bytes or text that some mail handling programs do not like, you may find difficulties. However, if you are using FTP or SSH/SCP, the non-conforming text files should be okay.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.4 in-out options

Specifying file selection and output modes.

output-prefix option (-o).

This is the “print output to file prefix.nn” option. This option takes a string argument PREFIX. Save the archive to files prefix.01 thru prefix.nn instead of sending all output to standard out. Must be specified when the --whole-size-limit or --split-size-limit options are specified.

When prefix contains a ‘%’ 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.

whole-size-limit option (-l).

This is the “split archive, not files, to size” option. This option takes a number argument SIZE.

This option has some usage constraints. It:

Limit the output file size to size bytes, but don’t split input files. If size is less than 1024, then it will be multiplied by 1024. The value may also be specified with a k, K, m or M suffix. The number is then multiplied by 1000, 1024, 1000000, or 1048576, respectively. 4M (4194304) is the maximum allowed.

Unlike the split-size-limit option, this allows the recipient of the shar files to unpack them in any order.

split-size-limit option (-L).

This is the “split archive or files to size” option. This option takes a number argument SIZE.

This option has some usage constraints. It:

Limit output file size to size bytes, splitting files if necessary. The allowed values are specified as with the --whole-size-limit option.

The archive parts created with this option must be unpacked in the correct order. If the recipient of the shell archives wants to put all of them in a single email folder (file), they will have to be saved in the correct order for unshar to unpack them all at once (using one of the split archive options). See unshar Invocation.

input-file-list option (-I).

This is the “read file list from a file” option. This option takes a string argument FILE. This option causes file to be reopened as standard input. If no files are found on the input line, then standard input is read for input file names. Use of this option will prohibit input files from being listed on the command line.

Input must be in a form similar to that generated by find, one filename per line. This switch is especially useful when the command line will not hold the list of files to be archived.

If the --intermix-type option is specified on the command line, then the compression options may be included in the standard input on lines by themselves and no file name may begin with a hyphen.

For example:

{ echo --compact xz
   find . -type f -print | sort
} | shar -S -p -L50K -o /somewhere/big

stdin-file-list option (-S).

This is the “read file list from standard input” option. This option is actually a no-op. It is a wrapper for --input-file-list=-.

NOTE: THIS OPTION IS DEPRECATED


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.5 headers options

Controlling the shar headers.

archive-name option (-n).

This is the “use name to document the archive” option. This option takes a string argument NAME. Name of archive to be included in the subject header of the shar files. See the --net-headers option.

submitter option (-s).

This is the “override the submitter name” option. This option takes a string argument WHO@WHERE. shar will normally determine the submitter name by querying the system. Use this option if it is being done on behalf of another.

net-headers option (-a).

This is the “output submitted-by: & archive-name: headers” option.

This option has some usage constraints. It:

Adds specialized email headers:

Submitted-by: who@where
Archive-name: name/part##

The who@where is normally derived, but can be specified with the --submitter option. The name must be provided with the --archive-name option. If the archive name includes a slash (/) character, then the /part## is omitted. Thus ‘-n xyzzy’ produces:

xyzzy/part01
xyzzy/part02

while ‘-n xyzzy/patch’ produces:

xyzzy/patch01
xyzzy/patch02

and ‘-n xyzzy/patch01.’ produces:

xyzzy/patch01.01
xyzzy/patch01.02

cut-mark option (-c).

This is the “start the shar with a cut line” option. A line saying ’Cut here’ is placed at the start of each output file.

translate option (-t).

This is the “translate messages in the script” option. Translate messages in the script. If you have set the ‘LANG’ environment variable, messages printed by shar will be in the specified language. The produced script will still be emitted using messages in the lingua franca of the computer world: English. This option will cause the script messages to appear in the languages specified by the ‘LANG’ environment variable set when the script is produced.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.6 xmit-defenses options

Protecting against transmission issues.

no-character-count option.

This is the “do not use ‘wc -c’ to check size” option. Do NOT check each file with ’wc -c’ after unpack. The default is to check.

no-md5-digest option (-D).

This is the “do not use md5sum digest to verify” option. Do not use md5sum digest to verify the unpacked files. The default is to check.

force-prefix option (-F).

This is the “apply the prefix character on every line” option. Forces the prefix character to be prepended to every line, even if not required. This option may slightly increase the size of the archive, especially if --uuencode or a compression option is used.

here-delimiter option (-d).

This is the “use delim to delimit the files” option. This option takes a string argument DELIM. Use DELIM to delimit the files in the shar instead of SHAR_EOF. This is for those who want to personalize their shar files. The delimiter will always be prefixed and suffixed with underscores.


Next: , Previous: , Up: shar Invocation   [Contents]

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, particularly 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.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.8 internationalization options

Internationalization options.

no-i18n option.

This is the “do not internationalize” option. 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.

print-text-domain-dir option.

This is the “print directory with shar messages” option. Prints the directory shar looks in to find messages files for different languages, then immediately exits.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.9 feedback options

User feedback/entertainment.

quiet option (-q).

This is the “do not output verbose messages” option. omit progress messages.

silent option.

This is an alias for the quiet option, see the quiet option documentation.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.10 presetting/configuring shar

Any option that is not marked as not presettable may be preset by loading values from configuration ("rc" or "ini") files.

libopts will search in $HOME for configuration (option) data. The environment variable HOME, is expanded and replaced when the program runs If this is a plain file, it is simply processed. If it is a directory, then a file named .sharrc is searched for within that directory.

Configuration files may be in a wide variety of formats. The basic format is an option name followed by a value (argument) on the same line. Values may be separated from the option name with a colon, equal sign or simply white space. Values may be continued across multiple lines by escaping the newline with a backslash.

Multiple programs may also share the same initialization file. Common options are collected at the top, followed by program specific segments. The segments are separated by lines like:

[SHAR]

or by

<?program shar>

Do not mix these styles within one configuration file.

Compound values and carefully constructed string values may also be specified using XML syntax:

<option-name>
   <sub-opt>...&lt;...&gt;...</sub-opt>
</option-name>

yielding an option-name.sub-opt string value of

"...<...>..."

AutoOpts does not track suboptions. You simply note that it is a hierarchicly valued option. AutoOpts does provide a means for searching the associated name/value pair list (see: optionFindValue).

The command line options relating to configuration and/or usage help are:

version (-v)

Print the program version to standard out, optionally with licensing information, then exit 0. The optional argument specifies how much licensing detail to provide. The default is to print the license name with the version. The licensing infomation may be selected with an option argument. Only the first letter of the argument is examined:

version

Only print the version.

copyright

Name the copyright usage licensing terms. This is the default.

verbose

Print the full copyright usage licensing terms.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.11 shar exit status

One of the following exit values will be returned:

0 (EXIT_SUCCESS)

Successful program execution.

1 (EXIT_OPTION_ERROR)

The command options were misconfigured.

2 (EXIT_FILE_NOT_FOUND)

a specified input could not be found

3 (EXIT_CANNOT_OPENDIR)

open/close of specified directory failed

4 (EXIT_FAILED)

Resource limit/miscelleaneous shar command failure

63 (EXIT_BUG)

There is a shar command bug. Please report it.

66 (EX_NOINPUT)

A specified configuration file could not be loaded.

70 (EX_SOFTWARE)

libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.12 shar Authors

The shar and unshar programs is the collective work of many authors. Many people contributed by reporting problems, suggesting various improvements or submitting actual code. A list of these people is in the THANKS file in the sharutils distribution.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.13 shar Bugs

Please put ‘sharutils’ in the subject line for emailed bug reports. It helps to spot the message.


Next: , Previous: , Up: shar Invocation   [Contents]

2.1.14 shar Examples

The first shows how to make a shell archive out of all C program sources. The second produces a shell archive with all .c and .h files, which unpacks silently. The third gives a shell archive of all uuencoded .arc files, into numbered files starting from arc.sh.01. The last example gives a shell archive which will use only the file names at unpack time.

shar *.c > cprog.shar
shar -Q *.[ch] > cprog.shar
shar -B -l28 -oarc.sh *.arc
shar -f /lcl/src/u*.c > u.sh

Next: , Previous: , Up: shar Invocation   [Contents]

2.1.15 shar Warnings

No attempt is made to restore the protection and modification dates for directories, even if this is done by default for files. 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, to conserve memory. Therefore, do not change the directory contents 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 it.

Use of the compression and encoding options will slow the archive process, perhaps considerably.

Use of the --query-user produces shars which will cause problems with many unshar procedures. Use this feature only for archives to be passed among agreeable parties. Certainly, query-user is NOT for shell archives which are to be distributed across the net. The use of compression in net shars will cause you to be flamed off the earth. Not using the --no-timestamp or --force-prefix options may also get you occasional complaints. Put these options into your ~/.sharrc file.


Previous: , Up: shar Invocation   [Contents]

2.1.16 shar See Also

unshar(1)


Next: , Previous: , Up: Basic   [Contents]

2.2 Invoking unshar

Unshar scans the input files (typically email messages) looking for the start of a shell archive. If no files are given, then standard input is processed instead. It then passes each archive discovered through an invocation of the shell program to unpack it.

This section was generated by AutoGen, using the agtexi-cmd template and the option descriptions for the unshar program. This software is released under the GNU General Public License, version 3 or later.


Next: , Up: unshar Invocation   [Contents]

2.2.1 unshar help/usage (--help)

This is the automatically generated usage text for unshar.

The text printed is the same whether selected with the help option (--help) or the more-help option (--more-help). more-help will print the usage text by passing it through a pager program. more-help is disabled on platforms without a working fork(2) function. The PAGER environment variable is used to select the program, defaulting to more. Both will exit with a status code of 0.

unshar (GNU sharutils) - unpack a shar archive
Usage:  unshar [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [<file>...]

   -d, --directory=DIR        unpack into the directory DIR
   -c, --overwrite            overwrite any pre-existing files
   -f, --force                an alias for the 'overwrite' option
   -E, --split-at=SPLIT-PAT   split input on SPLIT-PAT lines
   -e, --exit-0               split input on "exit 0" lines
                                - prohibits the option 'split-at'
   -D, --debug                debug the shell code
   -v, --version[=MODE]       output version information and exit
   -h, --help                 display extended usage information and exit
   -!, --more-help            extended usage information passed thru pager
   -R, --save-opts[=FILE]     save the option state to the config file FILE
   -r, --load-opts=FILE       load options from the config file FILE
                                - disabled as '--no-load-opts'
                                - may appear multiple times

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

If no arguments are provided, input arguments are read from stdin,
one per line; blank and '#'-prefixed lines are comments.
'stdin' may not be a terminal (tty).

The following option preset mechanisms are supported:
 - reading file $HOME/.sharrc

'unshar' scans the input files (typically email messages) looking for the
start of a shell archive.  If no files are given, then standard input is
processed instead.  It then passes each archive discovered through an
invocation of the shell program to unpack it.

Please send bug reports to:  <bug-gnu-utils@gnu.org>

Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.2 directory option (-d)

This is the “unpack into the directory dir” option. This option takes a string argument dir. The input file names are relative to the current directory when the program was started. This option tells unshar to insert a cd <dir> commad at the start of the shar text written to the shell.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.3 overwrite option (-c)

This is the “overwrite any pre-existing files” option. This option is passed through as an option to the shar file. Many shell archive scripts accept a -c argument to indicate that existing files should be overwritten.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.4 force option (-f)

This is an alias for the overwrite option, see the overwrite option documentation.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.5 split-at option (-E)

This is the “split input on split-mark lines” option. This option takes a string argument split-mark. With this option, unshar isolates each different shell archive from the others which have been placed in the same file, unpacking each in turn, from the beginning of the file to the end. Its proper operation relies on the fact that many shar files are terminated by a readily identifiable string at the start of the last line.

For example, noticing that most ‘.signatures’ have a double hyphen ("–") on a line right before them, one can then sometimes use --split-at=--. The signature will then be skipped, along with the headers of the following message.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.6 exit-0 option (-e)

This is the “split input on "exit 0" lines” option.

This option has some usage constraints. It:

Most shell archives end with a line consisting of simply "exit 0". This option is equivalent to (and conflicts with) --split-at="exit 0".


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.7 debug option (-D)

This is the “debug the shell code” option. "set -x" will be emitted into the code the shell interprets.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.8 presetting/configuring unshar

Any option that is not marked as not presettable may be preset by loading values from configuration ("rc" or "ini") files.

libopts will search in $HOME for configuration (option) data. The environment variable HOME, is expanded and replaced when the program runs If this is a plain file, it is simply processed. If it is a directory, then a file named .sharrc is searched for within that directory.

Configuration files may be in a wide variety of formats. The basic format is an option name followed by a value (argument) on the same line. Values may be separated from the option name with a colon, equal sign or simply white space. Values may be continued across multiple lines by escaping the newline with a backslash.

Multiple programs may also share the same initialization file. Common options are collected at the top, followed by program specific segments. The segments are separated by lines like:

[UNSHAR]

or by

<?program unshar>

Do not mix these styles within one configuration file.

Compound values and carefully constructed string values may also be specified using XML syntax:

<option-name>
   <sub-opt>...&lt;...&gt;...</sub-opt>
</option-name>

yielding an option-name.sub-opt string value of

"...<...>..."

AutoOpts does not track suboptions. You simply note that it is a hierarchicly valued option. AutoOpts does provide a means for searching the associated name/value pair list (see: optionFindValue).

The command line options relating to configuration and/or usage help are:

version (-v)

Print the program version to standard out, optionally with licensing information, then exit 0. The optional argument specifies how much licensing detail to provide. The default is to print the license name with the version. The licensing infomation may be selected with an option argument. Only the first letter of the argument is examined:

version

Only print the version.

copyright

Name the copyright usage licensing terms. This is the default.

verbose

Print the full copyright usage licensing terms.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.9 unshar exit status

One of the following exit values will be returned:

0 (EXIT_SUCCESS)

Successful program execution.

1 (EXIT_FAILURE)

There was an error in command usage.

2 (EXIT_POPEN_PROBLEM)

cannot spawn or write to a shell process

3 (EXIT_CANNOT_CREATE)

cannot create output file

4 (EXIT_BAD_DIRECTORY)

the working directory structure is invalid

5 (EXIT_NOMEM)

memory allocation failure

6 (EXIT_INVALID)

invalid input, does not contain a shar file

66 (EX_NOINPUT)

A specified configuration file could not be loaded.

70 (EX_SOFTWARE)

libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.10 unshar Authors

The shar and unshar programs is the collective work of many authors. Many people contributed by reporting problems, suggesting various improvements or submitting actual code. A list of these people is in the THANKS file in the sharutils distribution.


Next: , Previous: , Up: unshar Invocation   [Contents]

2.2.11 unshar Bugs

Please put ‘sharutils’ in the subject line for emailed bug reports. It helps to spot the message.


Previous: , Up: unshar Invocation   [Contents]

2.2.12 unshar See Also

shar(1)


Next: , Previous: , Up: Basic   [Contents]

2.3 Invoking uuencode

uuencode is used to create an ASCII representation of a file that can be sent over channels that may otherwise corrupt the data. Specifically, email cannot handle binary data and will often even insert a character when the six character sequence "\nFrom " is seen.

uuencode will read in-file if provided and otherwise read data from standard in and write the encoded form to standard out. The output will begin with a header line for use by uudecode giving it the resulting suggested file output-name and access mode. If the output-name is specifically /dev/stdout, then uudecode will emit the decoded file to standard out.

Note: uuencode uses buffered input and assumes that it is not hand typed from a tty. The consequence is that at a tty, you may need to hit Ctl-D several times to terminate input.

This section was generated by AutoGen, using the agtexi-cmd template and the option descriptions for the uuencode program. This software is released under the GNU General Public License, version 3 or later.


Next: , Up: uuencode Invocation   [Contents]

2.3.1 uuencode help/usage (--help)

This is the automatically generated usage text for uuencode.

The text printed is the same whether selected with the help option (--help) or the more-help option (--more-help). more-help will print the usage text by passing it through a pager program. more-help is disabled on platforms without a working fork(2) function. The PAGER environment variable is used to select the program, defaulting to more. Both will exit with a status code of 0.

uuencode (GNU sharutils) - encode a file into email friendly text
Usage:  uuencode [ -<flag> | --<name> ]... [<in-file>] <output-name>

   -m, --base64               convert using base64
   -e, --encode-file-name     encode the output file name
   -v, --version[=MODE]       output version information and exit
   -h, --help                 display extended usage information and exit
   -!, --more-help            extended usage information passed thru pager
   -R, --save-opts[=FILE]     save the option state to a config file FILE
   -r, --load-opts=FILE       load options from the config file FILE
                                - disabled with '--no-load-opts'
                                - may appear multiple times

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.

The following option preset mechanisms are supported:
 - reading file $HOME/.sharrc

'uuencode' is used to create an ASCII representation of a file that can be
sent over channels that may otherwise corrupt the data.  Specifically,
email cannot handle binary data and will often even insert a character when
the six character sequence "\nFrom " is seen.

'uuencode' will read 'in-file' if provided and otherwise read data from
standard in and write the encoded form to standard out.  The output will
begin with a header line for use by 'uudecode' giving it the resulting
suggested file 'output-name' and access mode.  If the 'output-name' is
specifically '/dev/stdout', then 'uudecode' will emit the decoded file to
standard out.

'Note': 'uuencode' uses buffered input and assumes that it is not hand
typed from a tty.  The consequence is that at a tty, you may need to hit
Ctl-D several times to terminate input.

Please send bug reports to:  <bug-gnu-utils@gnu.org>

Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.2 base64 option (-m)

This is the “convert using base64” option. By default, uuencode will encode using the traditional conversion. It is slower and less compact than base64. The encoded form of the file is expanded by 37% for UU encoding and by 35% for base64 encoding (3 bytes become 4 plus control information).


Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.3 encode-file-name option (-e)

This is the “encode the output file name” option. Since output file names may contain characters that are not handled well by various transmission modes, you may specify that the output-name be base64 encoded as well. (Traditional uuencoding of the file name is not supported.)


Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.4 presetting/configuring uuencode

Any option that is not marked as not presettable may be preset by loading values from configuration ("rc" or "ini") files.

libopts will search in $HOME for configuration (option) data. The environment variable HOME, is expanded and replaced when the program runs If this is a plain file, it is simply processed. If it is a directory, then a file named .sharrc is searched for within that directory.

Configuration files may be in a wide variety of formats. The basic format is an option name followed by a value (argument) on the same line. Values may be separated from the option name with a colon, equal sign or simply white space. Values may be continued across multiple lines by escaping the newline with a backslash.

Multiple programs may also share the same initialization file. Common options are collected at the top, followed by program specific segments. The segments are separated by lines like:

[UUENCODE]

or by

<?program uuencode>

Do not mix these styles within one configuration file.

Compound values and carefully constructed string values may also be specified using XML syntax:

<option-name>
   <sub-opt>...&lt;...&gt;...</sub-opt>
</option-name>

yielding an option-name.sub-opt string value of

"...<...>..."

AutoOpts does not track suboptions. You simply note that it is a hierarchicly valued option. AutoOpts does provide a means for searching the associated name/value pair list (see: optionFindValue).

The command line options relating to configuration and/or usage help are:

version (-v)

Print the program version to standard out, optionally with licensing information, then exit 0. The optional argument specifies how much licensing detail to provide. The default is to print the license name with the version. The licensing infomation may be selected with an option argument. Only the first letter of the argument is examined:

version

Only print the version.

copyright

Name the copyright usage licensing terms. This is the default.

verbose

Print the full copyright usage licensing terms.


Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.5 uuencode exit status

One of the following exit values will be returned:

0 (EXIT_SUCCESS)

Successful program execution.

1 (EXIT_FAILURE)

The operation failed or the command syntax was not valid.

66 (EX_NOINPUT)

A specified configuration file could not be loaded.

70 (EX_SOFTWARE)

libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.


Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.6 uuencode Bugs

Please put ‘sharutils’ in the subject line for emailed bug reports. It helps to spot the message.


Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.7 uuencode Standards

This implementation is compliant with P1003.2b/D11.


Next: , Previous: , Up: uuencode Invocation   [Contents]

2.3.8 uuencode History

The uuencode command first appeared in BSD 4.0.


Previous: , Up: uuencode Invocation   [Contents]

2.3.9 uuencode See Also

uudecode(1), uuencode(5)


Previous: , Up: Basic   [Contents]

2.4 Invoking uudecode

If no file(s) are provided, then standard input is decoded. uudecode transforms uuencoded files into their original form.

The encoded file(s) may be specified on the command line, or one may be read from standard input. The output file name is specified in the encoded file, but may be overridden with the -o option. It will have the mode of the original file, except that setuid and execute bits are not retained. If the output file is specified to be /dev/stdout or -, the result will be written to standard output. If there are multiple input files and the second or subsquent file specifies standard output, the decoded data will be written to the same file as the previous output. Don’t do that.

uudecode ignores any leading and trailing lines. It looks for a line that starts with "‘begin’" and proceeds until the end-of-encoding marker is found. The program determines from the header line of the encoded file which of the two supported encoding schemes was used and whether or not the output file name has been encoded with base64 encoding. See uuencode(5).

This section was generated by AutoGen, using the agtexi-cmd template and the option descriptions for the uudecode program. This software is released under the GNU General Public License, version 3 or later.


Next: , Up: uudecode Invocation   [Contents]

2.4.1 uudecode help/usage (--help)

This is the automatically generated usage text for uudecode.

The text printed is the same whether selected with the help option (--help) or the more-help option (--more-help). more-help will print the usage text by passing it through a pager program. more-help is disabled on platforms without a working fork(2) function. The PAGER environment variable is used to select the program, defaulting to more. Both will exit with a status code of 0.

uudecode (GNU sharutils) - decode an encoded file
Usage:  uudecode [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [<file>...]

   -o, --output-file=str      direct output to file
   -c, --ignore-chmod         ignore fchmod(3P) errors
   -v, --version[=MODE]       output version information and exit
   -h, --help                 display extended usage information and exit
   -!, --more-help            extended usage information passed thru pager
   -R, --save-opts[=FILE]     save the option state to a config file FILE
   -r, --load-opts=FILE       load options from the config file FILE
                                - disabled with '--no-load-opts'
                                - may appear multiple times

Options are specified by doubled hyphens and their name or by a single
hyphen and the flag character.
If no 'file'(s) are provided, then standard input is decoded.

The following option preset mechanisms are supported:
 - reading file $HOME/.sharrc

'uudecode' transforms uuencoded files into their original form.

The encoded file(s) may be specified on the command line, or one may be
read from standard input.  The output file name is specified in the encoded
file, but may be overridden with the '-o' option.  It will have the mode of
the original file, except that setuid and execute bits are not retained.  If
the output file is specified to be '/dev/stdout' or '-', the result will be
written to standard output.  If there are multiple input files and the
second or subsquent file specifies standard output, the decoded data will
be written to the same file as the previous output.  Don't do that.

'uudecode' ignores any leading and trailing lines.  It looks for a line
that starts with "'begin'" and proceeds until the end-of-encoding marker is
found.  The program determines from the header line of the encoded file
which of the two supported encoding schemes was used and whether or not the
output file name has been encoded with base64 encoding.  See 'uuencode(5)'.

Please send bug reports to:  <bug-gnu-utils@gnu.org>

Next: , Previous: , Up: uudecode Invocation   [Contents]

2.4.2 output-file option (-o)

This is the “direct output to file” option. This option takes a string argument file. If specified, decoded data are written to this file. When multiple inputs are specified on the command line, this option cannot be specified. All decoded data must be written to the file name encoded in the data.


Next: , Previous: , Up: uudecode Invocation   [Contents]

2.4.3 ignore-chmod option (-c)

This is the “ignore fchmod(3p) errors” option. By default, if the output file permissions cannot be changed to the permissions specified in the encoded data, the file will not be written out and execution stops. This option will cause that error to be ignored. The resulting file will have all the data, but the incorrect mode settings.

fchmod() errors are also ignored if POSIXLY_CORRECT is set in the environment. RE: ‘http://austingroupbugs.net/view.php?id=635

A warning is always emitted when fchmod() fails.


Next: , Previous: , Up: uudecode Invocation   [Contents]

2.4.4 presetting/configuring uudecode

Any option that is not marked as not presettable may be preset by loading values from configuration ("rc" or "ini") files.

libopts will search in $HOME for configuration (option) data. The environment variable HOME, is expanded and replaced when the program runs If this is a plain file, it is simply processed. If it is a directory, then a file named .sharrc is searched for within that directory.

Configuration files may be in a wide variety of formats. The basic format is an option name followed by a value (argument) on the same line. Values may be separated from the option name with a colon, equal sign or simply white space. Values may be continued across multiple lines by escaping the newline with a backslash.

Multiple programs may also share the same initialization file. Common options are collected at the top, followed by program specific segments. The segments are separated by lines like:

[UUDECODE]

or by

<?program uudecode>

Do not mix these styles within one configuration file.

Compound values and carefully constructed string values may also be specified using XML syntax:

<option-name>
   <sub-opt>...&lt;...&gt;...</sub-opt>
</option-name>

yielding an option-name.sub-opt string value of

"...<...>..."

AutoOpts does not track suboptions. You simply note that it is a hierarchicly valued option. AutoOpts does provide a means for searching the associated name/value pair list (see: optionFindValue).

The command line options relating to configuration and/or usage help are:

version (-v)

Print the program version to standard out, optionally with licensing information, then exit 0. The optional argument specifies how much licensing detail to provide. The default is to print the license name with the version. The licensing infomation may be selected with an option argument. Only the first letter of the argument is examined:

version

Only print the version.

copyright

Name the copyright usage licensing terms. This is the default.

verbose

Print the full copyright usage licensing terms.


Next: , Previous: , Up: uudecode Invocation   [Contents]

2.4.5 uudecode exit status

One of the following exit values will be returned:

0 (EXIT_SUCCESS)

Successful program execution.

1 (EXIT_OPTION_ERROR)

The command options were misconfigured.

2 (EXIT_INVALID)

(warning) One or more input files contained no valid data

4 (EXIT_NO_INPUT)

(warning) The specified input file was not found

8 (EXIT_NO_OUTPUT)

The specified output file could not be created (error); or else one of the output files could not be written or its access mode could not be changed (warnings). The accompanying message(s) will distinguish.

9 (EXIT_NO_MEM)

No process memory available

66 (EX_NOINPUT)

A specified configuration file could not be loaded.

70 (EX_SOFTWARE)

libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you.


Next: , Previous: , Up: uudecode Invocation   [Contents]

2.4.6 uudecode Bugs

Please put ‘sharutils’ in the subject line for emailed bug reports. It helps to spot the message.

If more than one name in the encoded files are the same, or if the second or following input files specifies standard output for the output file, then the result is probably not what is expected. Specifically, standard output will be appended to and named output files will be replaced.


Next: , Previous: , Up: uudecode Invocation   [Contents]

2.4.7 uudecode Standards

This implementation is compliant with P1003.2b/D11.


Previous: , Up: uudecode Invocation   [Contents]

2.4.8 uudecode See Also

uuencode(1), uuencode(5)


Previous: , Up: uudecode Invocation   [Contents]