| 1 |
.\" Copyright (c) 1989-2015 |
| 2 |
.\" The Regents of the University of California. |
| 3 |
.\" All rights reserved. |
| 4 |
.\" |
| 5 |
.\" Redistribution and use in source and binary forms, with or without |
| 6 |
.\" modification, are permitted provided that the following conditions |
| 7 |
.\" are met: |
| 8 |
.\" 1. Redistributions of source code must retain the above copyright |
| 9 |
.\" notice, this list of conditions and the following disclaimer. |
| 10 |
.\" 2. Redistributions in binary form must reproduce the above copyright |
| 11 |
.\" notice, this list of conditions and the following disclaimer in the |
| 12 |
.\" documentation and/or other materials provided with the distribution. |
| 13 |
.\" 3. All advertising materials mentioning features or use of this software |
| 14 |
.\" must display the following acknowledgement: |
| 15 |
.\" This product includes software developed by the University of |
| 16 |
.\" California, Berkeley and its contributors. |
| 17 |
.\" 4. Neither the name of the University nor the names of its contributors |
| 18 |
.\" may be used to endorse or promote products derived from this software |
| 19 |
.\" without specific prior written permission. |
| 20 |
.\" |
| 21 |
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 22 |
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 23 |
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 24 |
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 25 |
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 26 |
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 27 |
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 28 |
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 29 |
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 30 |
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 31 |
.\" SUCH DAMAGE. |
| 32 |
.\" |
| 33 |
.TH UUENCODE 5 |
| 34 |
.SH NAME |
| 35 |
uuencode \- format of an encoded uuencode file |
| 36 |
.SH DESCRIPTION |
| 37 |
Files output by |
| 38 |
uuencode(1) |
| 39 |
consist of a header line, |
| 40 |
followed by a number of body lines, |
| 41 |
and a trailer line. |
| 42 |
The |
| 43 |
uudecode(1) |
| 44 |
command will ignore any lines preceding the header or |
| 45 |
following the trailer. |
| 46 |
Lines preceding a header must not, of course, look like a header. |
| 47 |
.PP |
| 48 |
The header line is distinguished by having the first 5 characters be |
| 49 |
.I begin |
| 50 |
followed by a space, or else a hyphen and either |
| 51 |
.I base64 |
| 52 |
or |
| 53 |
.I encoded |
| 54 |
or both (also separated with a hyphen). |
| 55 |
The |
| 56 |
.I base64 |
| 57 |
option says the file has been encoded using base64. |
| 58 |
The |
| 59 |
.I encoded |
| 60 |
option says the output file |
| 61 |
.I name |
| 62 |
has been base64 encoded. It is never encoded with traditional uuencoding. |
| 63 |
This is a GNU extension. |
| 64 |
These are followed by a mode (in octal), and a string which names the |
| 65 |
remote file. The mode is separated from the |
| 66 |
.I begin |
| 67 |
clause and the file name by a single space character. |
| 68 |
.SS "Traditional uuencoding" |
| 69 |
.PP |
| 70 |
The traditional |
| 71 |
.I uuencoded |
| 72 |
file body consists of a number of lines, each at most 62 characters |
| 73 |
long (including the trailing newline). These consist of a character |
| 74 |
count letter, followed by the encoded characters, followed by a newline. |
| 75 |
The character count is a single printing character, |
| 76 |
and represents an integer, the number of bytes |
| 77 |
the rest of the line represents. |
| 78 |
Such integers are always in the range from 0 to 63 and can |
| 79 |
be determined by subtracting the character space (octal 40) |
| 80 |
from the character. |
| 81 |
.PP |
| 82 |
Groups of 3 bytes are stored in 4 characters, 6 bits per character. |
| 83 |
All are offset by a space to make the characters printing. |
| 84 |
The last line may be shorter than the normal 45 bytes. |
| 85 |
If the size is not a multiple of 3, this fact can be determined |
| 86 |
by the value of the count on the last line. |
| 87 |
Extra garbage will be included to make the character count a multiple |
| 88 |
of 4. |
| 89 |
The body is terminated by a line with a count of zero. |
| 90 |
This line consists of one ASCII space. |
| 91 |
.PP |
| 92 |
The trailer line consists of |
| 93 |
.I end |
| 94 |
on a line by itself. |
| 95 |
.PP |
| 96 |
.SS "base64 encoding" |
| 97 |
.I base64 |
| 98 |
encoded files follow the specified format for the body, but |
| 99 |
also include a |
| 100 |
.I begin-base64 |
| 101 |
header and a trailer line of four \fI=\fP characters. |
| 102 |
.SH EXAMPLES |
| 103 |
.nf |
| 104 |
.na |
| 105 |
.in +5 |
| 106 |
begin-base64-encoded 644 VE9ETw== |
| 107 |
.in -5 |
| 108 |
.fi |
| 109 |
.ad |
| 110 |
This introduces a base64 encoded file named, |
| 111 |
.I TODO |
| 112 |
with that name encoded using base64 encoding. |
| 113 |
.sp |
| 114 |
.nf |
| 115 |
.na |
| 116 |
.in +5 |
| 117 |
begin-encoded 644 5$]$3P`` |
| 118 |
.in -5 |
| 119 |
.fi |
| 120 |
.ad |
| 121 |
This introduces an encoded file named, |
| 122 |
.I TODO |
| 123 |
with that name encoded using uuencoding. |
| 124 |
The encoding is a lot less friendly. Please prefer base64 encoding. |
| 125 |
.SH CONFORMING TO |
| 126 |
IEEE Std 1003.1, plus extensions |
| 127 |
.sp |
| 128 |
The |
| 129 |
.I \-encoded |
| 130 |
suffix to the |
| 131 |
.I begin |
| 132 |
header line is a GNU extension. Recipients must have the GNU |
| 133 |
.I uudecode |
| 134 |
program to decode them. |
| 135 |
.SH SEE ALSO |
| 136 |
uuencode(1), uudecode(1), base64(1GNU) |
| 137 |
.SH HISTORY |
| 138 |
The |
| 139 |
.I uuencode |
| 140 |
file format appeared in BSD 4.0 . |