@node uudecode Invocation
@section Invoking uudecode
@pindex uudecode
@cindex decode an encoded file
@ignore
#  -*- buffer-read-only: t -*- vi: set ro:
#
# DO NOT EDIT THIS FILE   (invoke-uudecode.texi)
#
# It has been AutoGen-ed
# From the definitions    uudecode-opts.def
# and the template file   agtexi-cmd.tpl
@end ignore

If no @file{file}(s) are provided, then standard input is decoded.
@file{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 @option{-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 @file{/dev/stdout} or @file{-}, 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.

@file{uudecode} ignores any leading and trailing lines.  It looks
for a line that starts with "@samp{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 @file{uuencode(5)}.

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

@menu
* uudecode usage::                  uudecode help/usage (@option{--help})
* uudecode output-file::            output-file option (-o)
* uudecode ignore-chmod::           ignore-chmod option (-c)
* uudecode config::                 presetting/configuring uudecode
* uudecode exit status::            exit status
* uudecode Bugs::                   Bugs
* uudecode Standards::              Standards
* uudecode See Also::               See Also
@end menu

@node uudecode usage
@subsection uudecode help/usage (@option{--help})
@cindex uudecode help

This is the automatically generated usage text for uudecode.

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

@exampleindent 0
@example
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>
@end example
@exampleindent 4

@node uudecode output-file
@subsection output-file option (-o)
@cindex uudecode-output-file

This is the ``direct output to @file{file}'' option.
This option takes a string argument @file{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.
@node uudecode ignore-chmod
@subsection ignore-chmod option (-c)
@cindex uudecode-ignore-chmod

This is the ``ignore @code{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.

@code{fchmod()} errors are also ignored if
@env{POSIXLY_CORRECT} is set in the environment.  RE:
@indicateurl{http://austingroupbugs.net/view.php?id=635}

A warning is always emitted when @code{fchmod()} fails.


@node uudecode config
@subsection presetting/configuring uudecode

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


@noindent
@code{libopts} will search in @file{$HOME} for configuration (option) data.
The environment variable @code{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 @file{.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:
@example
[UUDECODE]
@end example
@noindent
or by
@example
<?program uudecode>
@end example
@noindent
Do not mix these styles within one configuration file.

Compound values and carefully constructed string values may also be
specified using XML syntax:
@example
<option-name>
   <sub-opt>...&lt;...&gt;...</sub-opt>
</option-name>
@end example
@noindent
yielding an @code{option-name.sub-opt} string value of
@example
"...<...>..."
@end example
@code{AutoOpts} does not track suboptions.  You simply note that it is a
hierarchicly valued option.  @code{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:

@subsubheading 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:

@table @samp
@item version
Only print the version.
@item copyright
Name the copyright usage licensing terms.  This is the default.
@item verbose
Print the full copyright usage licensing terms.
@end table

@node uudecode exit status
@subsection uudecode exit status

One of the following exit values will be returned:
@table @samp
@item 0 (EXIT_SUCCESS)
Successful program execution.
@item 1 (EXIT_OPTION_ERROR)
The command options were misconfigured.
@item 2 (EXIT_INVALID)
(warning) One or more input files contained no valid data
@item 4 (EXIT_NO_INPUT)
(warning) The specified input file was not found
@item 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.
@item 9 (EXIT_NO_MEM)
No process memory available
@item 66 (EX_NOINPUT)
A specified configuration file could not be loaded.
@item 70 (EX_SOFTWARE)
libopts had an internal operational error.  Please report
it to autogen-users@@lists.sourceforge.net.  Thank you.
@end table
@node uudecode Bugs
@subsection uudecode Bugs
Please put @samp{sharutils} in the subject line for emailed bug
reports.  It helps to spot the message.


If more than one @file{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.
@node uudecode Standards
@subsection uudecode Standards
This implementation is compliant with P1003.2b/D11.
@node uudecode See Also
@subsection uudecode See Also
uuencode(1), uuencode(5)
