Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
uuencode.html (30068B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>uuencode</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/uudecode.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/uustat.html" accesskey="N">Next 19 >>></a></td> 20 </tr> 21 </table> 22 <hr align="left" width="100%"></div> 23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 24 <center><font size="2">The Open Group Base Specifications Issue 8<br> 25 IEEE Std 1003.1-2024<br> 26 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 27 <hr size="2" noshade> 28 <a name="top" id="top"></a> <a name="uuencode" id="uuencode"></a> <a name="tag_20_142" id="tag_20_142"></a><!-- uuencode --> 29 <h4 class="mansect"><a name="tag_20_142_01" id="tag_20_142_01"></a>NAME</h4> 30 <blockquote>uuencode — encode a binary file</blockquote> 31 <h4 class="mansect"><a name="tag_20_142_02" id="tag_20_142_02"></a>SYNOPSIS</h4> 32 <blockquote class="synopsis"> 33 <p><code><tt>uuencode</tt> <b>[</b><tt>-m</tt><b>] [</b><i>file</i><b>]</b> <i>decode_pathname</i></code></p> 34 </blockquote> 35 <h4 class="mansect"><a name="tag_20_142_03" id="tag_20_142_03"></a>DESCRIPTION</h4> 36 <blockquote> 37 <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 38 specified, to standard output. The output shall be encoded using one of the algorithms described in the STDOUT section and shall 39 include the file access permission bits (in <a href="../utilities/chmod.html"><i>chmod</i></a> octal or symbolic notation) of the 40 input file and the <i>decode_pathname</i>, for re-creation of the file on another system that conforms to this volume of 41 POSIX.1-2024.</p> 42 </blockquote> 43 <h4 class="mansect"><a name="tag_20_142_04" id="tag_20_142_04"></a>OPTIONS</h4> 44 <blockquote> 45 <p>The <i>uuencode</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 46 Guidelines</i></a> .</p> 47 <p>The following option shall be supported by the implementation:</p> 48 <dl compact> 49 <dd></dd> 50 <dt><b>-m</b></dt> 51 <dd>Encode the output using the MIME Base64 algorithm described in STDOUT. If <b>-m</b> is not specified, the historical algorithm 52 described in STDOUT shall be used.</dd> 53 </dl> 54 </blockquote> 55 <h4 class="mansect"><a name="tag_20_142_05" id="tag_20_142_05"></a>OPERANDS</h4> 56 <blockquote> 57 <p>The following operands shall be supported:</p> 58 <dl compact> 59 <dd></dd> 60 <dt><i>decode_pathname</i></dt> 61 <dd><br> 62 The pathname of the file into which the <a href="../utilities/uudecode.html"><i>uudecode</i></a> utility shall place the decoded 63 file. Specifying a <i>decode_pathname</i> operand of <b>-</b> or <b>/dev/stdout</b> shall indicate that <a href= 64 "../utilities/uudecode.html"><i>uudecode</i></a> is to use standard output. If there are characters in <i>decode_pathname</i> that 65 are not in the portable filename character set the results are unspecified.</dd> 66 <dt><i>file</i></dt> 67 <dd>A pathname of the file to be encoded.</dd> 68 </dl> 69 </blockquote> 70 <h4 class="mansect"><a name="tag_20_142_06" id="tag_20_142_06"></a>STDIN</h4> 71 <blockquote> 72 <p>See the INPUT FILES section.</p> 73 </blockquote> 74 <h4 class="mansect"><a name="tag_20_142_07" id="tag_20_142_07"></a>INPUT FILES</h4> 75 <blockquote> 76 <p>Input files can be files of any type.</p> 77 </blockquote> 78 <h4 class="mansect"><a name="tag_20_142_08" id="tag_20_142_08"></a>ENVIRONMENT VARIABLES</h4> 79 <blockquote> 80 <p>The following environment variables shall affect the execution of <i>uuencode</i>:</p> 81 <dl compact> 82 <dd></dd> 83 <dt><i>LANG</i></dt> 84 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 85 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 86 variables used to determine the values of locale categories.)</dd> 87 <dt><i>LC_ALL</i></dt> 88 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 89 <dt><i>LC_CTYPE</i></dt> 90 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 91 opposed to multi-byte characters in arguments and input files).</dd> 92 <dt><i>LC_MESSAGES</i></dt> 93 <dd><br> 94 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 95 <dt><i>NLSPATH</i></dt> 96 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 97 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 98 "0"></dd> 99 </dl> 100 </blockquote> 101 <h4 class="mansect"><a name="tag_20_142_09" id="tag_20_142_09"></a>ASYNCHRONOUS EVENTS</h4> 102 <blockquote> 103 <p>Default.</p> 104 </blockquote> 105 <h4 class="mansect"><a name="tag_20_142_10" id="tag_20_142_10"></a>STDOUT</h4> 106 <blockquote> 107 <h5><a name="tag_20_142_10_01" id="tag_20_142_10_01"></a>uuencode Base64 Algorithm</h5> 108 <p>The standard output shall be a text file (encoded in the character set of the current locale) that begins with the line:</p> 109 <pre> 110 <tt>"begin-base64Δ%sΔ%s\n", <</tt><i>mode</i><tt>>, <</tt><i>decode_pathname</i><tt>> 111 </tt></pre> 112 <p>and ends with the line:</p> 113 <pre> 114 <tt>"====\n" 115 </tt></pre> 116 <p>In both cases, the lines shall have no preceding or trailing <blank> characters.</p> 117 <p>The encoding process represents 24-bit groups of input bits as output strings of four encoded characters. Proceeding from left 118 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 119 treated as four concatenated 6-bit groups, each of which shall be translated into a single digit in the Base64 alphabet. When 120 encoding a bit stream via the Base64 encoding, the bit stream shall be presumed to be ordered with the most-significant bit first. 121 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 122 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= 123 "#tagtcjh_24">uuencode Base64 Values</a> .</p> 124 <p class="caption"><a name="tagtcjh_24" id="tagtcjh_24"></a> Table: uuencode Base64 Values</p> 125 <center> 126 <table border="1" cellpadding="3" align="center"> 127 <tr valign="top"> 128 <th align="center"> 129 <p class="tent"><b>Value</b></p> 130 </th> 131 <th align="center"> 132 <p class="tent"><b>Encoding</b></p> 133 </th> 134 <th align="left"> 135 <p class="tent"> </p> 136 </th> 137 <th align="center"> 138 <p class="tent"><b>Value</b></p> 139 </th> 140 <th align="center"> 141 <p class="tent"><b>Encoding</b></p> 142 </th> 143 <th align="left"> 144 <p class="tent"> </p> 145 </th> 146 <th align="center"> 147 <p class="tent"><b>Value</b></p> 148 </th> 149 <th align="center"> 150 <p class="tent"><b>Encoding</b></p> 151 </th> 152 <th align="left"> 153 <p class="tent"> </p> 154 </th> 155 <th align="center"> 156 <p class="tent"><b>Value</b></p> 157 </th> 158 <th align="center"> 159 <p class="tent"><b>Encoding</b></p> 160 </th> 161 </tr> 162 <tr valign="top"> 163 <td align="left"> 164 <p class="tent">0</p> 165 </td> 166 <td align="center"> 167 <p class="tent">A</p> 168 </td> 169 <td align="left"> 170 <p class="tent"> </p> 171 </td> 172 <td align="left"> 173 <p class="tent">17</p> 174 </td> 175 <td align="center"> 176 <p class="tent">R</p> 177 </td> 178 <td align="left"> 179 <p class="tent"> </p> 180 </td> 181 <td align="left"> 182 <p class="tent">34</p> 183 </td> 184 <td align="center"> 185 <p class="tent">i</p> 186 </td> 187 <td align="left"> 188 <p class="tent"> </p> 189 </td> 190 <td align="left"> 191 <p class="tent">51</p> 192 </td> 193 <td align="center"> 194 <p class="tent">z</p> 195 </td> 196 </tr> 197 <tr valign="top"> 198 <td align="left"> 199 <p class="tent">1</p> 200 </td> 201 <td align="center"> 202 <p class="tent">B</p> 203 </td> 204 <td align="left"> 205 <p class="tent"> </p> 206 </td> 207 <td align="left"> 208 <p class="tent">18</p> 209 </td> 210 <td align="center"> 211 <p class="tent">S</p> 212 </td> 213 <td align="left"> 214 <p class="tent"> </p> 215 </td> 216 <td align="left"> 217 <p class="tent">35</p> 218 </td> 219 <td align="center"> 220 <p class="tent">j</p> 221 </td> 222 <td align="left"> 223 <p class="tent"> </p> 224 </td> 225 <td align="left"> 226 <p class="tent">52</p> 227 </td> 228 <td align="center"> 229 <p class="tent">0</p> 230 </td> 231 </tr> 232 <tr valign="top"> 233 <td align="left"> 234 <p class="tent">2</p> 235 </td> 236 <td align="center"> 237 <p class="tent">C</p> 238 </td> 239 <td align="left"> 240 <p class="tent"> </p> 241 </td> 242 <td align="left"> 243 <p class="tent">19</p> 244 </td> 245 <td align="center"> 246 <p class="tent">T</p> 247 </td> 248 <td align="left"> 249 <p class="tent"> </p> 250 </td> 251 <td align="left"> 252 <p class="tent">36</p> 253 </td> 254 <td align="center"> 255 <p class="tent">k</p> 256 </td> 257 <td align="left"> 258 <p class="tent"> </p> 259 </td> 260 <td align="left"> 261 <p class="tent">53</p> 262 </td> 263 <td align="center"> 264 <p class="tent">1</p> 265 </td> 266 </tr> 267 <tr valign="top"> 268 <td align="left"> 269 <p class="tent">3</p> 270 </td> 271 <td align="center"> 272 <p class="tent">D</p> 273 </td> 274 <td align="left"> 275 <p class="tent"> </p> 276 </td> 277 <td align="left"> 278 <p class="tent">20</p> 279 </td> 280 <td align="center"> 281 <p class="tent">U</p> 282 </td> 283 <td align="left"> 284 <p class="tent"> </p> 285 </td> 286 <td align="left"> 287 <p class="tent">37</p> 288 </td> 289 <td align="center"> 290 <p class="tent">l</p> 291 </td> 292 <td align="left"> 293 <p class="tent"> </p> 294 </td> 295 <td align="left"> 296 <p class="tent">54</p> 297 </td> 298 <td align="center"> 299 <p class="tent">2</p> 300 </td> 301 </tr> 302 <tr valign="top"> 303 <td align="left"> 304 <p class="tent">4</p> 305 </td> 306 <td align="center"> 307 <p class="tent">E</p> 308 </td> 309 <td align="left"> 310 <p class="tent"> </p> 311 </td> 312 <td align="left"> 313 <p class="tent">21</p> 314 </td> 315 <td align="center"> 316 <p class="tent">V</p> 317 </td> 318 <td align="left"> 319 <p class="tent"> </p> 320 </td> 321 <td align="left"> 322 <p class="tent">38</p> 323 </td> 324 <td align="center"> 325 <p class="tent">m</p> 326 </td> 327 <td align="left"> 328 <p class="tent"> </p> 329 </td> 330 <td align="left"> 331 <p class="tent">55</p> 332 </td> 333 <td align="center"> 334 <p class="tent">3</p> 335 </td> 336 </tr> 337 <tr valign="top"> 338 <td align="left"> 339 <p class="tent">5</p> 340 </td> 341 <td align="center"> 342 <p class="tent">F</p> 343 </td> 344 <td align="left"> 345 <p class="tent"> </p> 346 </td> 347 <td align="left"> 348 <p class="tent">22</p> 349 </td> 350 <td align="center"> 351 <p class="tent">W</p> 352 </td> 353 <td align="left"> 354 <p class="tent"> </p> 355 </td> 356 <td align="left"> 357 <p class="tent">39</p> 358 </td> 359 <td align="center"> 360 <p class="tent">n</p> 361 </td> 362 <td align="left"> 363 <p class="tent"> </p> 364 </td> 365 <td align="left"> 366 <p class="tent">56</p> 367 </td> 368 <td align="center"> 369 <p class="tent">4</p> 370 </td> 371 </tr> 372 <tr valign="top"> 373 <td align="left"> 374 <p class="tent">6</p> 375 </td> 376 <td align="center"> 377 <p class="tent">G</p> 378 </td> 379 <td align="left"> 380 <p class="tent"> </p> 381 </td> 382 <td align="left"> 383 <p class="tent">23</p> 384 </td> 385 <td align="center"> 386 <p class="tent">X</p> 387 </td> 388 <td align="left"> 389 <p class="tent"> </p> 390 </td> 391 <td align="left"> 392 <p class="tent">40</p> 393 </td> 394 <td align="center"> 395 <p class="tent">o</p> 396 </td> 397 <td align="left"> 398 <p class="tent"> </p> 399 </td> 400 <td align="left"> 401 <p class="tent">57</p> 402 </td> 403 <td align="center"> 404 <p class="tent">5</p> 405 </td> 406 </tr> 407 <tr valign="top"> 408 <td align="left"> 409 <p class="tent">7</p> 410 </td> 411 <td align="center"> 412 <p class="tent">H</p> 413 </td> 414 <td align="left"> 415 <p class="tent"> </p> 416 </td> 417 <td align="left"> 418 <p class="tent">24</p> 419 </td> 420 <td align="center"> 421 <p class="tent">Y</p> 422 </td> 423 <td align="left"> 424 <p class="tent"> </p> 425 </td> 426 <td align="left"> 427 <p class="tent">41</p> 428 </td> 429 <td align="center"> 430 <p class="tent">p</p> 431 </td> 432 <td align="left"> 433 <p class="tent"> </p> 434 </td> 435 <td align="left"> 436 <p class="tent">58</p> 437 </td> 438 <td align="center"> 439 <p class="tent">6</p> 440 </td> 441 </tr> 442 <tr valign="top"> 443 <td align="left"> 444 <p class="tent">8</p> 445 </td> 446 <td align="center"> 447 <p class="tent">I</p> 448 </td> 449 <td align="left"> 450 <p class="tent"> </p> 451 </td> 452 <td align="left"> 453 <p class="tent">25</p> 454 </td> 455 <td align="center"> 456 <p class="tent">Z</p> 457 </td> 458 <td align="left"> 459 <p class="tent"> </p> 460 </td> 461 <td align="left"> 462 <p class="tent">42</p> 463 </td> 464 <td align="center"> 465 <p class="tent">q</p> 466 </td> 467 <td align="left"> 468 <p class="tent"> </p> 469 </td> 470 <td align="left"> 471 <p class="tent">59</p> 472 </td> 473 <td align="center"> 474 <p class="tent">7</p> 475 </td> 476 </tr> 477 <tr valign="top"> 478 <td align="left"> 479 <p class="tent">9</p> 480 </td> 481 <td align="center"> 482 <p class="tent">J</p> 483 </td> 484 <td align="left"> 485 <p class="tent"> </p> 486 </td> 487 <td align="left"> 488 <p class="tent">26</p> 489 </td> 490 <td align="center"> 491 <p class="tent">a</p> 492 </td> 493 <td align="left"> 494 <p class="tent"> </p> 495 </td> 496 <td align="left"> 497 <p class="tent">43</p> 498 </td> 499 <td align="center"> 500 <p class="tent">r</p> 501 </td> 502 <td align="left"> 503 <p class="tent"> </p> 504 </td> 505 <td align="left"> 506 <p class="tent">60</p> 507 </td> 508 <td align="center"> 509 <p class="tent">8</p> 510 </td> 511 </tr> 512 <tr valign="top"> 513 <td align="left"> 514 <p class="tent">10</p> 515 </td> 516 <td align="center"> 517 <p class="tent">K</p> 518 </td> 519 <td align="left"> 520 <p class="tent"> </p> 521 </td> 522 <td align="left"> 523 <p class="tent">27</p> 524 </td> 525 <td align="center"> 526 <p class="tent">b</p> 527 </td> 528 <td align="left"> 529 <p class="tent"> </p> 530 </td> 531 <td align="left"> 532 <p class="tent">44</p> 533 </td> 534 <td align="center"> 535 <p class="tent">s</p> 536 </td> 537 <td align="left"> 538 <p class="tent"> </p> 539 </td> 540 <td align="left"> 541 <p class="tent">61</p> 542 </td> 543 <td align="center"> 544 <p class="tent">9</p> 545 </td> 546 </tr> 547 <tr valign="top"> 548 <td align="left"> 549 <p class="tent">11</p> 550 </td> 551 <td align="center"> 552 <p class="tent">L</p> 553 </td> 554 <td align="left"> 555 <p class="tent"> </p> 556 </td> 557 <td align="left"> 558 <p class="tent">28</p> 559 </td> 560 <td align="center"> 561 <p class="tent">c</p> 562 </td> 563 <td align="left"> 564 <p class="tent"> </p> 565 </td> 566 <td align="left"> 567 <p class="tent">45</p> 568 </td> 569 <td align="center"> 570 <p class="tent">t</p> 571 </td> 572 <td align="left"> 573 <p class="tent"> </p> 574 </td> 575 <td align="left"> 576 <p class="tent">62</p> 577 </td> 578 <td align="center"> 579 <p class="tent">+</p> 580 </td> 581 </tr> 582 <tr valign="top"> 583 <td align="left"> 584 <p class="tent">12</p> 585 </td> 586 <td align="center"> 587 <p class="tent">M</p> 588 </td> 589 <td align="left"> 590 <p class="tent"> </p> 591 </td> 592 <td align="left"> 593 <p class="tent">29</p> 594 </td> 595 <td align="center"> 596 <p class="tent">d</p> 597 </td> 598 <td align="left"> 599 <p class="tent"> </p> 600 </td> 601 <td align="left"> 602 <p class="tent">46</p> 603 </td> 604 <td align="center"> 605 <p class="tent">u</p> 606 </td> 607 <td align="left"> 608 <p class="tent"> </p> 609 </td> 610 <td align="left"> 611 <p class="tent">63</p> 612 </td> 613 <td align="center"> 614 <p class="tent">/</p> 615 </td> 616 </tr> 617 <tr valign="top"> 618 <td align="left"> 619 <p class="tent">13</p> 620 </td> 621 <td align="center"> 622 <p class="tent">N</p> 623 </td> 624 <td align="left"> 625 <p class="tent"> </p> 626 </td> 627 <td align="left"> 628 <p class="tent">30</p> 629 </td> 630 <td align="center"> 631 <p class="tent">e</p> 632 </td> 633 <td align="left"> 634 <p class="tent"> </p> 635 </td> 636 <td align="left"> 637 <p class="tent">47</p> 638 </td> 639 <td align="center"> 640 <p class="tent">v</p> 641 </td> 642 <td align="left"> 643 <p class="tent"> </p> 644 </td> 645 <td align="left"> 646 <p class="tent"> </p> 647 </td> 648 <td align="center"> 649 <p class="tent"> </p> 650 </td> 651 </tr> 652 <tr valign="top"> 653 <td align="left"> 654 <p class="tent">14</p> 655 </td> 656 <td align="center"> 657 <p class="tent">O</p> 658 </td> 659 <td align="left"> 660 <p class="tent"> </p> 661 </td> 662 <td align="left"> 663 <p class="tent">31</p> 664 </td> 665 <td align="center"> 666 <p class="tent">f</p> 667 </td> 668 <td align="left"> 669 <p class="tent"> </p> 670 </td> 671 <td align="left"> 672 <p class="tent">48</p> 673 </td> 674 <td align="center"> 675 <p class="tent">w</p> 676 </td> 677 <td align="left"> 678 <p class="tent"> </p> 679 </td> 680 <td align="left"> 681 <p class="tent">(pad)</p> 682 </td> 683 <td align="center"> 684 <p class="tent">=</p> 685 </td> 686 </tr> 687 <tr valign="top"> 688 <td align="left"> 689 <p class="tent">15</p> 690 </td> 691 <td align="center"> 692 <p class="tent">P</p> 693 </td> 694 <td align="left"> 695 <p class="tent"> </p> 696 </td> 697 <td align="left"> 698 <p class="tent">32</p> 699 </td> 700 <td align="center"> 701 <p class="tent">g</p> 702 </td> 703 <td align="left"> 704 <p class="tent"> </p> 705 </td> 706 <td align="left"> 707 <p class="tent">49</p> 708 </td> 709 <td align="center"> 710 <p class="tent">x</p> 711 </td> 712 <td align="left"> 713 <p class="tent"> </p> 714 </td> 715 <td align="left"> 716 <p class="tent"> </p> 717 </td> 718 <td align="center"> 719 <p class="tent"> </p> 720 </td> 721 </tr> 722 <tr valign="top"> 723 <td align="left"> 724 <p class="tent">16</p> 725 </td> 726 <td align="center"> 727 <p class="tent">Q</p> 728 </td> 729 <td align="left"> 730 <p class="tent"> </p> 731 </td> 732 <td align="left"> 733 <p class="tent">33</p> 734 </td> 735 <td align="center"> 736 <p class="tent">h</p> 737 </td> 738 <td align="left"> 739 <p class="tent"> </p> 740 </td> 741 <td align="left"> 742 <p class="tent">50</p> 743 </td> 744 <td align="center"> 745 <p class="tent">y</p> 746 </td> 747 <td align="left"> 748 <p class="tent"> </p> 749 </td> 750 <td align="left"> 751 <p class="tent"> </p> 752 </td> 753 <td align="center"> 754 <p class="tent"> </p> 755 </td> 756 </tr> 757 </table> 758 </center> 759 <p class="tent">The character referenced by the index shall be placed in the output string.</p> 760 <p class="tent">The output stream (encoded bytes) shall be represented in lines of no more than 76 characters each. All line breaks 761 or other characters not found in the table shall be ignored by decoding software (see <a href= 762 "../utilities/uudecode.html#"><i>uudecode</i></a> ).</p> 763 <p class="tent">Special processing shall be performed if fewer than 24 bits are available at the end of a message or encapsulated 764 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 765 available in an input group, zero bits shall be added (on the right) to form an integral number of 6-bit groups. Output character 766 positions that are not required to represent actual input data shall be set to the character <tt>'='</tt>. Since all Base64 input 767 is an integral number of octets, only the following cases can arise:</p> 768 <ol> 769 <li class="tent">The final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output 770 shall be an integral multiple of 4 characters with no <tt>'='</tt> padding.</li> 771 <li class="tent">The final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output shall be three 772 characters followed by one <tt>'='</tt> padding character.</li> 773 <li class="tent">The final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output shall be two 774 characters followed by two <tt>'='</tt> padding characters.</li> 775 </ol> 776 <p class="tent">A terminating <tt>"===="</tt> evaluates to nothing and denotes the end of the encoded data.</p> 777 <h5><a name="tag_20_142_10_02" id="tag_20_142_10_02"></a>uuencode Historical Algorithm</h5> 778 <p class="tent">The standard output shall be a text file (encoded in the character set of the current locale) that begins with the 779 line:</p> 780 <pre> 781 <tt>"beginΔ%sΔ%s\n" <</tt><i>mode</i><tt>>, <</tt><i>decode_pathname</i><tt>> 782 </tt></pre> 783 <p class="tent">and ends with the line:</p> 784 <pre> 785 <tt>"end\n" 786 </tt></pre> 787 <p class="tent">In both cases, the lines shall have no preceding or trailing <blank> characters.</p> 788 <p class="tent">The algorithm that shall be used for lines in between <b>begin</b> and <b>end</b> takes three octets as input and 789 writes four characters of output by splitting the input at six-bit intervals into four octets, containing data in the lower six 790 bits only. These octets shall be converted to characters in the ISO/IEC 646:1991 standard encoded character set by adding a 791 value of 0x20 to each octet, so that each octet is in the range [0x20,0x5f], and then optionally replacing any 0x20 octets with 792 0x60. If necessary, these characters shall then be translated into the corresponding character codes for the codeset in use in the 793 current locale. For example, the octet 0x41, representing <tt>'A'</tt>, would be translated to <tt>'A'</tt> in the current codeset, 794 such as 0xc1 if it were EBCDIC; the octet 0x20, representing <space>, would optionally be replaced with 0x60, representing 795 <tt>'`'</tt>, and then translated to either <space> (0x40 if EBCDIC) or <tt>'`'</tt> (0x79 if EBCDIC), respectively.</p> 796 <p class="tent">Where the bits of two octets are combined, the least significant bits of the first octet shall be shifted left and 797 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 798 be converted into the four octets:</p> 799 <pre> 800 <tt>0x20 + (( A >> 2 ) & 0x3F) 801 0x20 + (((A << 4) |'(XX' ((B >> 4) & 0xF)) & 0x3F) 802 0x20 + (((B << 2) |'(XX' ((C >> 6) & 0x3)) & 0x3F) 803 0x20 + (( C ) & 0x3F) 804 </tt></pre> 805 <p class="tent">before any replacement of 0x20 with 0x60 and translation into the local character set.</p> 806 <p class="tent">Each encoded line shall contain a length character, equal to the number of characters to be decoded plus 0x20 807 translated to the local character set as described above, followed by between 1 and 45, inclusive, encoded characters. The last 808 encoded line, or the <b>begin</b> line if the input is empty, shall be followed by a line containing only a <space> or 809 <tt>'`'</tt> character before the terminating <newline>.</p> 810 </blockquote> 811 <h4 class="mansect"><a name="tag_20_142_11" id="tag_20_142_11"></a>STDERR</h4> 812 <blockquote> 813 <p>The standard error shall be used only for diagnostic messages.</p> 814 </blockquote> 815 <h4 class="mansect"><a name="tag_20_142_12" id="tag_20_142_12"></a>OUTPUT FILES</h4> 816 <blockquote> 817 <p>None.</p> 818 </blockquote> 819 <h4 class="mansect"><a name="tag_20_142_13" id="tag_20_142_13"></a>EXTENDED DESCRIPTION</h4> 820 <blockquote> 821 <p>None.</p> 822 </blockquote> 823 <h4 class="mansect"><a name="tag_20_142_14" id="tag_20_142_14"></a>EXIT STATUS</h4> 824 <blockquote> 825 <p>The following exit values shall be returned:</p> 826 <dl compact> 827 <dd></dd> 828 <dt> 0</dt> 829 <dd>Successful completion.</dd> 830 <dt>>0</dt> 831 <dd>An error occurred.</dd> 832 </dl> 833 </blockquote> 834 <h4 class="mansect"><a name="tag_20_142_15" id="tag_20_142_15"></a>CONSEQUENCES OF ERRORS</h4> 835 <blockquote> 836 <p>Default.</p> 837 </blockquote> 838 <hr> 839 <div class="box"><em>The following sections are informative.</em></div> 840 <h4 class="mansect"><a name="tag_20_142_16" id="tag_20_142_16"></a>APPLICATION USAGE</h4> 841 <blockquote> 842 <p>The file is expanded by 35 percent (each three octets become four, plus control information) causing it to take longer to 843 transmit.</p> 844 <p class="tent">Since this utility is intended to create files to be used for data interchange between systems with possibly 845 different codesets, and to represent binary data as a text file, the ISO/IEC 646:1991 standard was chosen for a midpoint in 846 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 847 the ISO/IEC 646:1991 standard codeset, it might not be a text file (at least because the <newline> characters might not 848 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 849 codeset, it would be perfectly compatible with that system's <a href="../utilities/uudecode.html"><i>uudecode</i></a>. If it was 850 transmitted over a mail system or sent to a machine with a different codeset, it is assumed that, as for every other text file, 851 some translation mechanism would convert it (by the time it reached a user on the other system) into an appropriate codeset. This 852 translation only makes sense from the local codeset, not if the file has been put into a ISO/IEC 646:1991 standard 853 representation first. Similarly, files processed by <i>uuencode</i> can be placed in <a href="../utilities/pax.html"><i>pax</i></a> 854 archives, intermixed with other text files in the same codeset.</p> 855 <p class="tent">Since <a href="../utilities/uudecode.html"><i>uudecode</i></a> treats a <i>decode_pathname</i> of <b>-</b> to mean 856 decode to standard output, in order to specify that a file named <b>-</b> is to be created, <i>decode_pathname</i> should be 857 specified using an alternative pathname, for example <b>./-</b>. Likewise, in order to specify that a file with the pathname 858 <b>/dev/stdout</b> is to be written, <i>decode_pathname</i> should be specified as, for example, <b>///dev/stdout</b>.</p> 859 </blockquote> 860 <h4 class="mansect"><a name="tag_20_142_17" id="tag_20_142_17"></a>EXAMPLES</h4> 861 <blockquote> 862 <p>None.</p> 863 </blockquote> 864 <h4 class="mansect"><a name="tag_20_142_18" id="tag_20_142_18"></a>RATIONALE</h4> 865 <blockquote> 866 <p>A new algorithm was added at the request of the international community to parallel work in RFC 2045 (MIME). As with the 867 historical <i>uuencode</i> format, the Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a 868 form that is not humanly readable. A 65-character subset of the ISO/IEC 646:1991 standard is used, enabling 6 bits to be 869 represented per printable character. (The extra 65th character, <tt>'='</tt>, is used to signify a special processing 870 function.)</p> 871 <p class="tent">This subset has the important property that it is represented identically in all versions of the 872 ISO/IEC 646:1991 standard, including US ASCII, and all characters in the subset are also represented identically in all 873 versions of EBCDIC. The historical <i>uuencode</i> algorithm does not share this property, which is the reason that a second 874 algorithm was added to the ISO POSIX-2 standard.</p> 875 <p class="tent">The string <tt>"===="</tt> was used for the termination instead of the end used in the original format because the 876 latter is a string that could be valid encoded input.</p> 877 <p class="tent">In an early draft, the <b>-m</b> option was named <b>-b</b> (for Base64), but it was renamed to reflect its 878 relationship to the RFC 2045. A <b>-u</b> was also present to invoke the default algorithm, but since this was not historical 879 practice, it was omitted as being unnecessary.</p> 880 <p class="tent">See the RATIONALE section in <a href="../utilities/uudecode.html#"><i>uudecode</i></a> for the derivation of the 881 <b>/dev/stdout</b> symbol.</p> 882 <p class="tent">Historically the encoding used only octets in the range [0x20,0x5f], and thus the encoded lines could contain 883 trailing spaces, which were at risk of being stripped by whatever transport method was used to send the file. To avoid this problem 884 some implementations use 0x60 instead of 0x20, resulting in <tt>'`'</tt> characters instead of spaces in the output, and 885 implementations are encouraged to do this.</p> 886 </blockquote> 887 <h4 class="mansect"><a name="tag_20_142_19" id="tag_20_142_19"></a>FUTURE DIRECTIONS</h4> 888 <blockquote> 889 <p>None.</p> 890 </blockquote> 891 <h4 class="mansect"><a name="tag_20_142_20" id="tag_20_142_20"></a>SEE ALSO</h4> 892 <blockquote> 893 <p><a href="../utilities/chmod.html#tag_20_17"><i>chmod</i></a> , <a href="../utilities/mailx.html#"><i>mailx</i></a> , <a href= 894 "../utilities/uudecode.html#"><i>uudecode</i></a></p> 895 <p class="tent">XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 896 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p> 897 </blockquote> 898 <h4 class="mansect"><a name="tag_20_142_21" id="tag_20_142_21"></a>CHANGE HISTORY</h4> 899 <blockquote> 900 <p>First released in Issue 4.</p> 901 </blockquote> 902 <h4 class="mansect"><a name="tag_20_142_22" id="tag_20_142_22"></a>Issue 6</h4> 903 <blockquote> 904 <p>This utility is marked as part of the User Portability Utilities option.</p> 905 <p class="tent">The Base64 algorithm and the ability to output to <b>/dev/stdout</b> are added as specified in the 906 IEEE P1003.2b draft standard.</p> 907 </blockquote> 908 <h4 class="mansect"><a name="tag_20_142_23" id="tag_20_142_23"></a>Issue 7</h4> 909 <blockquote> 910 <p>The <i>uuencode</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now 911 an option for interactive utilities.</p> 912 <p class="tent">SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p> 913 </blockquote> 914 <h4 class="mansect"><a name="tag_20_142_24" id="tag_20_142_24"></a>Issue 8</h4> 915 <blockquote> 916 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 917 <p class="tent">Austin Group Defect 1140 is applied, changing the description of the <i>uuencode</i> historical algorithm.</p> 918 <p class="tent">Austin Group Defect 1544 is applied, changing the OPERANDS and APPLICATION USAGE sections.</p> 919 </blockquote> 920 <div class="box"><em>End of informative text.</em></div> 921 <hr> 922 <p> </p> 923 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 924 <hr size="2" noshade> 925 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 926 POSIX™ is a Trademark of The IEEE.<br> 927 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 928 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 929 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 930 ]</font></center> 931 <hr size="2" noshade> 932 <div class="NAVHEADER"> 933 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 934 <tr class="nav"> 935 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/uudecode.html" accesskey="P"><<< 936 Previous</a></td> 937 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 938 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/uustat.html" accesskey="N">Next 939 >>></a></td> 940 </tr> 941 </table> 942 <hr align="left" width="100%"></div> 943 </body> 944 </html>