xref: /netbsd/usr.bin/uuencode/uuencode.1 (revision 6550d01e)
1.\"	$NetBSD: uuencode.1,v 1.21 2009/03/10 19:54:43 joerg 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 November 30, 2008
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 | Fl p
46.Op Ar encoded-file ...
47.Sh DESCRIPTION
48.Nm
49and
50.Nm uudecode
51are used to transmit binary files over transmission mediums
52that do not support other than simple
53.Tn ASCII
54data.
55.Pp
56The following options are available:
57.Bl -tag -width ".Fl m"
58.It Fl m
59Use base64 encoding.
60.El
61.Pp
62.Nm
63reads
64.Ar inputfile
65(or by default the standard input) and writes an encoded version
66to the standard output.
67The encoding uses only printing
68.Tn ASCII
69characters and includes the
70mode of the file and the operand
71.Ar outputname
72for use by
73.Nm uudecode .
74.Pp
75.Nm uudecode
76transforms
77.Em uuencoded
78files (or by default, the standard input) into the original form.
79The resulting file is named
80.Ar outputname
81as recorded in the encoded file,
82and will have the mode of the original file except that setuid
83and execute bits are not retained; if the
84.Fl p
85option is specified, the data will be written to the standard output
86instead.
87.Nm uudecode
88ignores any leading and trailing lines.
89.Sh EXIT STATUS
90The
91.Nm uudecode
92and
93.Nm
94utilities exits 0 on success, and \*[Gt]0 if an error occurs.
95.Sh EXAMPLES
96The following example packages up a source tree, compresses it,
97uuencodes it and mails it to a user on another system.
98.Pp
99.Bd -literal -offset indent -compact
100tar czf \- src_tree \&| uuencode src_tree.tgz \&| mail user@example.com
101.Ed
102.Pp
103On the other system, if the user saves the mail to the file
104.Pa temp ,
105the following example creates the file
106.Pa src_tree.tgz
107and extracts it to make a copy of the original tree.
108.Pp
109.Bd -literal -offset indent -compact
110uudecode temp
111tar xzf src_tree.tgz
112.Ed
113.Sh SEE ALSO
114.Xr gzip 1 ,
115.Xr mail 1 ,
116.Xr tar 1 ,
117.\".Xr uucp 1 ,
118.Xr uuencode 5
119.Sh STANDARDS
120The
121.Nm uudecode
122and
123.Nm
124utilities conform to
125.St -p1003.2-92 .
126.Sh HISTORY
127The
128.Nm uudecode
129and
130.Nm
131utilities appeared in
132.Bx 4.0 .
133.Sh BUGS
134The encoded form of the file is expanded by 35% (3 bytes become 4 plus
135control information).
136