xref: /freebsd-13.1/usr.bin/uuencode/uuencode.1 (revision 00a91cb7)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)uuencode.1	8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
35.Dd January 27, 2002
36.Dt UUENCODE 1
37.Os
38.Sh NAME
39.Nm uuencode ,
40.Nm uudecode ,
41.Nm b64encode ,
42.Nm b64decode
43.Nd encode/decode a binary file
44.Sh SYNOPSIS
45.Nm
46.Op Fl m
47.Op Fl o Ar output_file
48.Op Ar file
49.Ar name
50.Nm uudecode
51.Op Fl cips
52.Op Ar
53.Nm uudecode
54.Op Fl i
55.Fl o Ar output_file
56.Nm b64encode
57.Op Fl o Ar output_file
58.Op Ar file
59.Ar name
60.Nm b64decode
61.Op Fl cips
62.Op Ar
63.Nm b64decode
64.Op Fl i
65.Fl o Ar output_file
66.Op Ar file
67.Sh DESCRIPTION
68The
69.Nm
70and
71.Nm uudecode
72utilities are used to transmit binary files over transmission mediums
73that do not support other than simple
74.Tn ASCII
75data.
76The
77.Nm b64encode
78utility is synonymous with
79.Nm
80with the
81.Fl m
82flag specified.
83The
84.Nm b64decode
85utility is synonymous with
86.Nm uudecode .
87.Pp
88The
89.Nm
90utility reads
91.Ar file
92(or by default the standard input) and writes an encoded version
93to the standard output, or
94.Ar output_file
95if one has been specified.
96The encoding uses only printing
97.Tn ASCII
98characters and includes the
99mode of the file and the operand
100.Ar name
101for use by
102.Nm uudecode .
103.Pp
104The
105.Nm uudecode
106utility transforms
107.Em uuencoded
108files (or by default, the standard input) into the original form.
109The resulting file is named either
110.Ar name
111or (depending on options passed to
112.Nm uudecode )
113.Ar output_file
114and will have the mode of the original file except that setuid
115and execute bits are not retained.
116The
117.Nm uudecode
118utility ignores any leading and trailing lines.
119.Pp
120The following options are available for
121.Nm :
122.Bl -tag -width ident
123.It Fl m
124Use the Base64 method of encoding, rather than the traditional
125.Nm
126algorithm.
127.It Fl o Ar output_file
128Output to
129.Ar output_file
130instead of standard output.
131.El
132.Pp
133The following options are available for
134.Nm uudecode :
135.Bl -tag -width ident
136.It Fl c
137Decode more than one uuencode'd file from
138.Ar file
139if possible.
140.It Fl i
141Do not overwrite files.
142.It Fl o Ar output_file
143Output to
144.Ar output_file
145instead of any pathname contained in the input data.
146.It Fl p
147Decode
148.Ar file
149and write output to standard output.
150.It Fl s
151Do not strip output pathname to base filename.
152By default
153.Nm uudecode
154deletes any prefix ending with the last slash '/' for security
155purpose.
156.El
157.Sh EXAMPLES
158The following example packages up a source tree, compresses it,
159uuencodes it and mails it to a user on another system.
160When
161.Nm uudecode
162is run on the target system, the file ``src_tree.tar.Z'' will be
163created which may then be uncompressed and extracted into the original
164tree.
165.Pp
166.Bd -literal -offset indent -compact
167tar cf \- src_tree \&| compress \&|
168uuencode src_tree.tar.Z \&| mail sys1!sys2!user
169.Ed
170.Pp
171The following example unpack all uuencode'd
172files from your mailbox into your current working directory.
173.Pp
174.Bd -literal -offset indent -compact
175uudecode -c < $MAIL
176.Ed
177.Pp
178The following example extract a compress'ed tar
179archive from your mailbox
180.Pp
181.Bd -literal -offset indent -compact
182uudecode -o /dev/stdout < $MAIL | zcat | tar xfv -
183.Ed
184.Sh SEE ALSO
185.Xr basename 1 ,
186.Xr compress 1 ,
187.Xr mail 1 ,
188.Xr uucp 1 ,
189.Xr uuencode 5
190.Sh BUGS
191Files encoded using the traditional algorithm are expanded by 35% (3
192bytes become 4 plus control information).
193.Sh HISTORY
194The
195.Nm uudecode
196and
197.Nm
198utilities appeared in
199.Bx 4.0 .
200