1 .\" $NetBSD: uuencode.1,v 1.26 2014/09/06 21:21:36 wiz Exp $
3 .\" Copyright (c) 1980, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)uuencode.1 8.1 (Berkeley) 6/6/93
38 .Nd encode/decode a binary file
46 .Op Fl p | Fl o Ar outputfile
47 .Op Ar encoded-file ...
52 are used to transmit binary files over transmission mediums
53 that do not support other than simple
57 The following options are available:
58 .Bl -tag -width ".Fl m"
63 the historical uuencode algorithm is the default.
66 by default the encoding is automatically detected.
67 .It Fl o Ar outputfile
68 .Po Nm uudecode No only . Pc
69 Send the decoded output data to
75 recorded in the header of the encoded data stream.
77 .Po Nm uudecode No only . Pc
78 Write the decoded file to standard output instead of to a file.
84 (or by default the standard input) and writes an encoded version
85 to (always) the standard output.
86 The encoding uses only printing
88 characters suitable for text-only transport media.
91 is inserted into the output header as the
96 The header also includes the mode (permissions) of the file.
101 files (or by default, the standard input) into the original form.
102 The resulting file is named
104 as recorded in the encoded file,
105 or as specified by the
108 and will have the mode of the original file except that setuid
109 and execute bits are not retained.
112 option is specified, or if the output file name is given as
114 then the data will be written to the standard output
115 instead of to a named file.
117 ignores any leading and trailing lines.
119 The encoded form of the file is expanded by 35%.
120 Every 3 bytes become 4 plus control information.
126 utilities exits 0 on success, and \*[Gt]0 if an error occurs.
128 The following example packages up a source tree, compresses it,
129 uuencodes it and mails it to a user on another system.
131 .Bd -literal -offset indent -compact
132 tar czf \- src_tree \&| uuencode src_tree.tgz \&| mail user@example.com
135 On the other system, if the user saves the mail to the file
137 the following example creates the file
139 and extracts it to make a copy of the original tree.
141 .Bd -literal -offset indent -compact
163 utilities appeared in
165 .Sh SECURITY CONSIDERATIONS
168 with files coming from dubious sources,
169 always either explicitly pass the
171 option or check the header (the first line) of the encoded file for
175 from a hostile source can overwrite important files.