1029 lines
25 KiB
HTML
1029 lines
25 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta name="generator" content="HTML Tidy, see www.w3.org">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
|
|
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
|
|
<title>uuencode</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="uuencode"></a> <a name="tag_04_163"></a><!-- uuencode -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_04_163_01"></a>NAME</h4>
|
|
|
|
<blockquote>uuencode - encode a binary file</blockquote>
|
|
|
|
<h4><a name="tag_04_163_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> uuencode</tt> <b>[</b><tt>-m</tt><b>][</b><i>file</i><b>]</b> <i>decode_pathname</i><tt><img src=
|
|
"../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>uuencode</i> utility shall write an encoded version of the named input file, or standard input if no <i>file</i> is
|
|
specified, to standard output. The output shall be encoded using one of the algorithms described in the STDOUT section and shall
|
|
include the file access permission bits (in <a href="../utilities/chmod.html"><i>chmod</i></a> octal or symbolic notation) of the
|
|
input file and the <i>decode_pathname</i>, for re-creation of the file on another system that conforms to this volume of
|
|
IEEE Std 1003.1-2001.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_04"></a>OPTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>uuencode</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>.</p>
|
|
|
|
<p>The following option shall be supported by the implementation:</p>
|
|
|
|
<dl compact>
|
|
<dt><b>-m</b></dt>
|
|
|
|
<dd>Encode the output using the MIME Base64 algorithm described in STDOUT. If <b>-m</b> is not specified, the historical algorithm
|
|
described in STDOUT shall be used.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_05"></a>OPERANDS</h4>
|
|
|
|
<blockquote>
|
|
<p>The following operands shall be supported:</p>
|
|
|
|
<dl compact>
|
|
<dt><i>decode_pathname</i></dt>
|
|
|
|
<dd><br>
|
|
The pathname of the file into which the <a href="../utilities/uudecode.html"><i>uudecode</i></a> utility shall place the decoded
|
|
file. Specifying a <i>decode_pathname</i> operand of <b>/dev/stdout</b> shall indicate that <a href=
|
|
"../utilities/uudecode.html"><i>uudecode</i></a> is to use standard output. If there are characters in <i>decode_pathname</i> that
|
|
are not in the portable filename character set the results are unspecified.</dd>
|
|
|
|
<dt><i>file</i></dt>
|
|
|
|
<dd>A pathname of the file to be encoded.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_06"></a>STDIN</h4>
|
|
|
|
<blockquote>
|
|
<p>See the INPUT FILES section.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_07"></a>INPUT FILES</h4>
|
|
|
|
<blockquote>
|
|
<p>Input files can be files of any type.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_08"></a>ENVIRONMENT VARIABLES</h4>
|
|
|
|
<blockquote>
|
|
<p>The following environment variables shall affect the execution of <i>uuencode</i>:</p>
|
|
|
|
<dl compact>
|
|
<dt><i>LANG</i></dt>
|
|
|
|
<dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of
|
|
IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> for
|
|
the precedence of internationalization variables used to determine the values of locale categories.)</dd>
|
|
|
|
<dt><i>LC_ALL</i></dt>
|
|
|
|
<dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
|
|
|
|
<dt><i>LC_CTYPE</i></dt>
|
|
|
|
<dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
|
|
opposed to multi-byte characters in arguments and input files).</dd>
|
|
|
|
<dt><i>LC_MESSAGES</i></dt>
|
|
|
|
<dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard
|
|
error.</dd>
|
|
|
|
<dt><i>NLSPATH</i></dt>
|
|
|
|
<dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt=
|
|
"[Option End]" border="0"></dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_09"></a>ASYNCHRONOUS EVENTS</h4>
|
|
|
|
<blockquote>
|
|
<p>Default.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_10"></a>STDOUT</h4>
|
|
|
|
<blockquote>
|
|
<h5><a name="tag_04_163_10_01"></a>uuencode Base64 Algorithm</h5>
|
|
|
|
<p>The standard output shall be a text file (encoded in the character set of the current locale) that begins with the line:</p>
|
|
|
|
<pre>
|
|
<tt>"begin-base64<img src="../images/delta.gif" border="0">%s<img src="../images/delta.gif" border=
|
|
"0">%s\n", <</tt><i>mode</i><tt>>, <</tt><i>decode_pathname</i><tt>>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>and ends with the line:</p>
|
|
|
|
<pre>
|
|
<tt>"====\n"
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>In both cases, the lines shall have no preceding or trailing <blank>s.</p>
|
|
|
|
<p>The encoding process represents 24-bit groups of input bits as output strings of four encoded characters. Proceeding from left
|
|
to right, a 24-bit input group shall be formed by concatenating three 8-bit input groups. Each 24-bit input group then shall be
|
|
treated as four concatenated 6-bit groups, each of which shall be translated into a single digit in the Base64 alphabet. When
|
|
encoding a bit stream via the Base64 encoding, the bit stream shall be presumed to be ordered with the most-significant bit first.
|
|
That is, the first bit in the stream shall be the high-order bit in the first byte, and the eighth bit shall be the low-order bit
|
|
in the first byte, and so on. Each 6-bit group is used as an index into an array of 64 printable characters, as shown in <a href=
|
|
"#tagtcjh_19">uuencode Base64 Values</a> .</p>
|
|
|
|
<center><b><a name="tagtcjh_19"></a> Table: uuencode Base64 Values</b></center>
|
|
|
|
<center>
|
|
<table border="1" cellpadding="3" align="center">
|
|
<tr valign="top">
|
|
<th align="center">
|
|
<p class="tent"><b>Value</b></p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b>Encoding</b></p>
|
|
</th>
|
|
<th align="left">
|
|
<p class="tent">Value</p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b>Encoding</b></p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b>Value</b></p>
|
|
</th>
|
|
<th align="left">
|
|
<p class="tent">Encoding</p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b>Value</b></p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b>Encoding</b></p>
|
|
</th>
|
|
<th align="left">
|
|
<p class="tent"> </p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b> </b></p>
|
|
</th>
|
|
<th align="center">
|
|
<p class="tent"><b> </b></p>
|
|
</th>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">0</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">A</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">17</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">R</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">34</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">i</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">51</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">z</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">1</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">B</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">18</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">S</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">35</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">j</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">52</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">0</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">2</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">C</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">19</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">T</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">36</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">k</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">53</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">1</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">3</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">D</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">20</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">U</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">37</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">l</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">54</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">2</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">4</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">E</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">21</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">V</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">38</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">m</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">55</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">3</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">5</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">F</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">22</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">W</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">39</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">n</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">56</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">4</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">6</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">G</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">23</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">X</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">40</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">o</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">57</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">5</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">7</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">H</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">24</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">Y</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">41</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">p</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">58</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">6</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">8</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">I</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">25</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">Z</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">42</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">q</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">59</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">7</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">9</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">J</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">26</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">a</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">43</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">r</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">60</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">8</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">10</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">K</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">27</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">b</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">44</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">s</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">61</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">9</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">11</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">L</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">28</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">c</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">45</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">t</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">62</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">+</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">12</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">M</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">29</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">d</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">46</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">u</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">63</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">/</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">13</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">N</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">30</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">e</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">47</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">v</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">14</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">O</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">31</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">f</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">48</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">w</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">(pad)</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">=</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">15</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">P</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">32</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">g</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">49</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">x</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="left">
|
|
<p class="tent">16</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">Q</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">33</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">h</p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent">50</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent">y</p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="left">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
<td align="center">
|
|
<p class="tent"> </p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</center>
|
|
|
|
<p>The character referenced by the index shall be placed in the output string.</p>
|
|
|
|
<p>The output stream (encoded bytes) shall be represented in lines of no more than 76 characters each. All line breaks or other
|
|
characters not found in the table shall be ignored by decoding software (see <a href="uudecode.html"><i>uudecode</i></a> ).</p>
|
|
|
|
<p>Special processing shall be performed if fewer than 24 bits are available at the end of a message or encapsulated part of a
|
|
message. A full encoding quantum shall always be completed at the end of a message. When fewer than 24 input bits are available in
|
|
an input group, zero bits shall be added (on the right) to form an integral number of 6-bit groups. Output character positions that
|
|
are not required to represent actual input data shall be set to the character <tt>'='</tt> . Since all Base64 input is an integral
|
|
number of octets, only the following cases can arise:</p>
|
|
|
|
<ol>
|
|
<li>
|
|
<p>The final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output shall be an
|
|
integral multiple of 4 characters with no <tt>'='</tt> padding.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output shall be three characters
|
|
followed by one <tt>'='</tt> padding character.</p>
|
|
</li>
|
|
|
|
<li>
|
|
<p>The final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output shall be two characters followed
|
|
by two <tt>'='</tt> padding characters.</p>
|
|
</li>
|
|
</ol>
|
|
|
|
<p>A terminating <tt>"===="</tt> evaluates to nothing and denotes the end of the encoded data.</p>
|
|
|
|
<h5><a name="tag_04_163_10_02"></a>uuencode Historical Algorithm</h5>
|
|
|
|
<p>The standard output shall be a text file (encoded in the character set of the current locale) that begins with the line:</p>
|
|
|
|
<pre>
|
|
<tt>"begin<img src="../images/delta.gif" border="0">%s<img src="../images/delta.gif" border=
|
|
"0">%s\n" <</tt><i>mode</i><tt>>, <</tt><i>decode_pathname</i><tt>>
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>and ends with the line:</p>
|
|
|
|
<pre>
|
|
<tt>"end\n"
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>In both cases, the lines shall have no preceding or trailing <blank>s.</p>
|
|
|
|
<p>The algorithm that shall be used for lines in between <b>begin</b> and <b>end</b> takes three octets as input and writes four
|
|
characters of output by splitting the input at six-bit intervals into four octets, containing data in the lower six bits only.
|
|
These octets shall be converted to characters by adding a value of 0x20 to each octet, so that each octet is in the range
|
|
[0x20,0x5f], and then it shall be assumed to represent a printable character in the ISO/IEC 646:1991 standard encoded
|
|
character set. It then shall be translated into the corresponding character codes for the codeset in use in the current locale.
|
|
(For example, the octet 0x41, representing <tt>'A'</tt> , would be translated to <tt>'A'</tt> in the current codeset, such as 0xc1
|
|
if it were EBCDIC.)</p>
|
|
|
|
<p>Where the bits of two octets are combined, the least significant bits of the first octet shall be shifted left and combined with
|
|
the most significant bits of the second octet shifted right. Thus the three octets <i>A</i>, <i>B</i>, <i>C</i> shall be converted
|
|
into the four octets:</p>
|
|
|
|
<pre>
|
|
<tt>0x20 + (( A >> 2 ) & 0x3F)
|
|
0x20 + (((A << 4) | ((B >> 4) & 0xF)) & 0x3F)
|
|
0x20 + (((B << 2) | ((C >> 6) & 0x3)) & 0x3F)
|
|
0x20 + (( C ) & 0x3F)
|
|
</tt>
|
|
</pre>
|
|
|
|
<p>These octets then shall be translated into the local character set.</p>
|
|
|
|
<p>Each encoded line contains a length character, equal to the number of characters to be decoded plus 0x20 translated to the local
|
|
character set as described above, followed by the encoded characters. The maximum number of octets to be encoded on each line shall
|
|
be 45.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_11"></a>STDERR</h4>
|
|
|
|
<blockquote>
|
|
<p>The standard error shall be used only for diagnostic messages.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_12"></a>OUTPUT FILES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_13"></a>EXTENDED DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_14"></a>EXIT STATUS</h4>
|
|
|
|
<blockquote>
|
|
<p>The following exit values shall be returned:</p>
|
|
|
|
<dl compact>
|
|
<dt> 0</dt>
|
|
|
|
<dd>Successful completion.</dd>
|
|
|
|
<dt>>0</dt>
|
|
|
|
<dd>An error occurred.</dd>
|
|
</dl>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_15"></a>CONSEQUENCES OF ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p>Default.</p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_04_163_16"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>The file is expanded by 35 percent (each three octets become four, plus control information) causing it to take longer to
|
|
transmit.</p>
|
|
|
|
<p>Since this utility is intended to create files to be used for data interchange between systems with possibly different codesets,
|
|
and to represent binary data as a text file, the ISO/IEC 646:1991 standard was chosen for a midpoint in the algorithm as a
|
|
known reference point. The output from <i>uuencode</i> is a text file on the local system. If the output were in the
|
|
ISO/IEC 646:1991 standard codeset, it might not be a text file (at least because the <newline>s might not match), and
|
|
the goal of creating a text file would be defeated. If this text file was then carried to another machine with the same codeset, it
|
|
would be perfectly compatible with that system's <a href="../utilities/uudecode.html"><i>uudecode</i></a>. If it was transmitted
|
|
over a mail system or sent to a machine with a different codeset, it is assumed that, as for every other text file, some
|
|
translation mechanism would convert it (by the time it reached a user on the other system) into an appropriate codeset. This
|
|
translation only makes sense from the local codeset, not if the file has been put into a ISO/IEC 646:1991 standard
|
|
representation first. Similarly, files processed by <i>uuencode</i> can be placed in <a href="../utilities/pax.html"><i>pax</i></a>
|
|
archives, intermixed with other text files in the same codeset.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_17"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_18"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>A new algorithm was added at the request of the international community to parallel work in RFC 2045 (MIME). As with the
|
|
historical <i>uuencode</i> format, the Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a
|
|
form that is not humanly readable. A 65-character subset of the ISO/IEC 646:1991 standard is used, enabling 6 bits to be
|
|
represented per printable character. (The extra 65th character, <tt>'='</tt> , is used to signify a special processing
|
|
function.)</p>
|
|
|
|
<p>This subset has the important property that it is represented identically in all versions of the ISO/IEC 646:1991 standard,
|
|
including US ASCII, and all characters in the subset are also represented identically in all versions of EBCDIC. The historical
|
|
<i>uuencode</i> algorithm does not share this property, which is the reason that a second algorithm was added to the
|
|
ISO POSIX-2 standard.</p>
|
|
|
|
<p>The string <tt>"===="</tt> was used for the termination instead of the end used in the original format because the latter is a
|
|
string that could be valid encoded input.</p>
|
|
|
|
<p>In an early draft, the <b>-m</b> option was named <b>-b</b> (for Base64), but it was renamed to reflect its relationship to the
|
|
RFC 2045. A <b>-u</b> was also present to invoke the default algorithm, but since this was not historical practice, it was
|
|
omitted as being unnecessary.</p>
|
|
|
|
<p>See the RATIONALE section in <a href="uudecode.html"><i>uudecode</i></a> for the derivation of the <b>/dev/stdout</b>
|
|
symbol.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_19"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_20"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="chmod.html"><i>chmod</i>()</a> , <a href="mailx.html"><i>mailx</i></a> , <a href=
|
|
"uudecode.html"><i>uudecode</i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_21"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 4.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_04_163_22"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>This utility is marked as part of the User Portability Utilities option.</p>
|
|
|
|
<p>The Base64 algorithm and the ability to output to <b>/dev/stdout</b> are added as specified in the IEEE P1003.2b draft
|
|
standard.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<hr size="2" noshade>
|
|
<center><font size="2"><!--footer start-->
|
|
UNIX ® is a registered Trademark of The Open Group.<br>
|
|
POSIX ® is a registered Trademark of The IEEE.<br>
|
|
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
|
|
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
|
|
]</font></center>
|
|
|
|
<!--footer end-->
|
|
<hr size="2" noshade>
|
|
</body>
|
|
</html>
|
|
|