xref: /netbsd-src/usr.bin/uuencode/uuencode.1 (revision 413d532bcc3f62d122e56d92e13ac64825a40baf)
1.\"	$NetBSD: uuencode.1,v 1.22 2013/01/28 16:08:02 apb Exp $
2.\"
3.\" Copyright (c) 1980, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
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.
17.\"
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
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)uuencode.1	8.1 (Berkeley) 6/6/93
31.\"
32.Dd January 28, 2012
33.Dt UUENCODE 1
34.Os
35.Sh NAME
36.Nm uuencode ,
37.Nm uudecode
38.Nd encode/decode a binary file
39.Sh SYNOPSIS
40.Nm
41.Op Fl m
42.Op Ar inputfile
43.Ar outputname
44.Nm uudecode
45.Op Fl m
46.Op Fl p | Fl o Ar outputfile
47.Op Ar encoded-file ...
48.Sh DESCRIPTION
49.Nm
50and
51.Nm uudecode
52are used to transmit binary files over transmission mediums
53that do not support other than simple
54.Tn ASCII
55data.
56.Pp
57The following options are available:
58.Bl -tag -width ".Fl m"
59.It Fl m
60Use base64 encoding.
61The default is that
62.Nm
63uses the historical uuencode algorithm,
64and
65.Nm uudecode
66automatically detects the encoding.
67.It Fl o Ar outputname
68.Po Nm uudecode No only . Pc
69Use the specified
70.Ar outputname
71as the name of the output file.
72The default is that
73.Nm uudecode
74obtains the name of the output file from the data stream, where
75.Nm
76would have recorded it.
77.It Fl p
78.Po Nm uudecode No only . Pc
79Write the decoded file to stdout instead of to a named file.
80.El
81.Pp
82.Nm
83reads
84.Ar inputfile
85(or by default the standard input) and writes an encoded version
86to the standard output.
87The encoding uses only printing
88.Tn ASCII
89characters and includes the
90mode of the file and the operand
91.Ar outputname
92for use by
93.Nm uudecode .
94.Pp
95.Nm uudecode
96transforms
97.Em uuencoded
98files (or by default, the standard input) into the original form.
99The resulting file is named
100.Ar outputname
101as recorded in the encoded file,
102or as specified by the
103.Fl o
104option,
105and will have the mode of the original file except that setuid
106and execute bits are not retained.
107If the
108.Fl p
109option is specified, or if the output file name is given as
110.Pa /dev/stdout ,
111then the data will be written to the standard output
112instead of to a named file.
113.Nm uudecode
114ignores any leading and trailing lines.
115.Sh EXIT STATUS
116The
117.Nm uudecode
118and
119.Nm
120utilities exits 0 on success, and \*[Gt]0 if an error occurs.
121.Sh EXAMPLES
122The following example packages up a source tree, compresses it,
123uuencodes it and mails it to a user on another system.
124.Pp
125.Bd -literal -offset indent -compact
126tar czf \- src_tree \&| uuencode src_tree.tgz \&| mail user@example.com
127.Ed
128.Pp
129On the other system, if the user saves the mail to the file
130.Pa temp ,
131the following example creates the file
132.Pa src_tree.tgz
133and extracts it to make a copy of the original tree.
134.Pp
135.Bd -literal -offset indent -compact
136uudecode temp
137tar xzf src_tree.tgz
138.Ed
139.Sh SEE ALSO
140.Xr gzip 1 ,
141.Xr mail 1 ,
142.Xr tar 1 ,
143.\".Xr uucp 1 ,
144.Xr uuencode 5
145.Sh STANDARDS
146The
147.Nm uudecode
148and
149.Nm
150utilities conform to
151.St -p1003.1-2008 .
152.Sh HISTORY
153The
154.Nm uudecode
155and
156.Nm
157utilities appeared in
158.Bx 4.0 .
159.Sh BUGS
160The encoded form of the file is expanded by 35% (3 bytes become 4 plus
161control information).
162