The uudecode utility shall read a file, or standard input if no file is specified, that includes data created by the uuencode utility. The uudecode utility shall scan the input file, searching for data compatible with one of the formats specified in uuencode, and attempt to create or overwrite the file described by the data (or overridden by the -o option). The pathname shall be contained in the data or specified by the -o option. The file access permission bits and contents for the file to be produced shall be contained in that data. The mode bits of the created file (other than standard output) shall be set from the file access permission bits contained in the data; that is, other attributes of the mode, including the file mode creation mask (see umask() ), shall not affect the file being produced.
If the pathname of the file to be produced exists, and the user does not have write permission on that file, uudecode shall terminate with an error. If the pathname of the file to be produced exists, and the user has write permission on that file, the existing file shall be overwritten.
If the input data was produced by uuencode on a system with a different number of bits per byte than on the target system, the results of uudecode are unspecified.
The uudecode utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
The following option shall be supported by the implementation:
The following operand shall be supported:
The input files shall be files containing the output of uuencode.
The following environment variables shall affect the execution of uudecode:
If the file data header encoded by uuencode is - or /dev/stdout, or the -o /dev/stdout option overrides the file data, the standard output shall be in the same format as the file originally encoded by uuencode. Otherwise, the standard output shall not be used.
The standard error shall be used only for diagnostic messages.
The output file shall be in the same format as the file originally encoded by uuencode.
The following exit values shall be returned:
Default.
The following sections are informative.
The user who is invoking uudecode must have write permission on any file being created.
The output of uuencode is essentially an encoded bit stream that is not cognizant of byte boundaries. It is possible that a 9-bit byte target machine can process input from an 8-bit source, if it is aware of the requirement, but the reverse is unlikely to be satisfying. Of course, the only data that is meaningful for such a transfer between architectures is generally character data.
Input files are not necessarily text files, as stated by an early proposal. Although the uuencode output is a text file, that output could have been wrapped within another file or mail message that is not a text file.
The -o option is not historical practice, but was added at the request of WG15 so that the user could override the target pathname without having to edit the input data itself.
In early drafts, the [ -o outfile] option-argument allowed the use of - to mean standard output. The symbol - has only been used previously in IEEE Std 1003.1-2001 as a standard input indicator. The developers of the standard did not wish to overload the meaning of - in this manner. The /dev/stdout concept exists on most modern systems. The /dev/stdout syntax does not refer to a new special file. It is just a magic cookie to specify standard output.