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