📄 od.html
字号:
The number of bytes transformed by the output type specifiercmay be variable depending on the LC_CTYPE category.<p>The default number of bytes transformed by output type specifiersd,f,o,uandxwill correspond to the various C-language types as follows.If the<i><a href="c89.html">c89</a></i>compiler is present on the system, these specifierswill correspond to the sizes used by default in that compiler.Otherwise, these sizes are implementation-dependent.<ul><p><li>For the type specifier charactersd,o,uandx,the default number ofbytes will correspond to the size of theunderlying implementation's basic integral data type.For these specifier characters,the implementation will support values of theoptional number of bytes to be converted corresponding to the number ofbytes in the C-language types<b>char</b>,<b>short</b>,<b>int</b>and<b>long.</b>These numbers can also be specified by an application asthe charactersC,S,IandL,respectively.The byte orderused when interpreting numeric valuesis implementation-dependent, butwill correspond to the order in which a constant of the correspondingtype is stored in memory on the system.<br><p><li>For the type specifier characterf,the default number of byteswill correspond to the number of bytes inthe underlyingimplementation's basic double precision floating-point data type.The implementation will support values ofthe optional number of bytes to beconverted corresponding to the number of bytes in the C-language types<b>float,</b><b>double</b>and<b>long double</b>.These numbers can also bespecified by an application as the charactersF,DandL,respectively.<p></ul><p>The type specifier characteraspecifies that bytes are interpretedas named characters from theInternational Reference Version (IRV) of the ISO/IEC 646:1991 standard.Only the least significant seven bits of each byte will be used forthis type specification.Bytes with the values listed in the following tablewill be written using the corresponding names for those characters.<br><p><table bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Value</b><th align=center><b>Name</b><th align=center><b>Value</b><th align=center><b>Name</b><th align=center><b>Value</b><th align=center><b>Name</b><th align=center><b>Value</b><th align=center><b>Name</b><tr valign=top><td align=left>\000<td align=left><b>nul</b><td align=left>\001<td align=left><b>soh</b><td align=left>\002<td align=left><b>stx</b><td align=left>\003<td align=left><b>etx</b><tr valign=top><td align=left>\004<td align=left><b>eot</b><td align=left>\005<td align=left><b>enq</b><td align=left>\006<td align=left><b>ack</b><td align=left>\007<td align=left><b>bel</b><tr valign=top><td align=left>\010<td align=left><b>bs</b><td align=left>\011<td align=left><b>ht</b><td align=left>\012<td align=left><b>lf or nl<sup><small>*</small></sup></b><td align=left>\013<td align=left><b>vt</b><tr valign=top><td align=left>\014<td align=left><b>ff</b><td align=left>\015<td align=left><b>cr</b><td align=left>\016<td align=left><b>so</b><td align=left>\017<td align=left><b>si</b><tr valign=top><td align=left>\020<td align=left><b>dle</b><td align=left>\021<td align=left><b>dc1</b><td align=left>\022<td align=left><b>dc2</b><td align=left>\023<td align=left><b>dc3</b><tr valign=top><td align=left>\024<td align=left><b>dc4</b><td align=left>\025<td align=left><b>nak</b><td align=left>\026<td align=left><b>syn</b><td align=left>\027<td align=left><b>etb</b><tr valign=top><td align=left>\030<td align=left><b>can</b><td align=left>\031<td align=left><b>em</b><td align=left>\032<td align=left><b>sub</b><td align=left>\033<td align=left><b>esc</b><tr valign=top><td align=left>\034<td align=left><b>fs</b><td align=left>\035<td align=left><b>gs</b><td align=left>\036<td align=left><b>rs</b><td align=left>\037<td align=left><b>us</b><tr valign=top><td align=left>\040<td align=left><b>sp</b><td align=left>\177<td align=left><b>del</b><td align=left> <td align=left> <td align=left> <td align=left> </table><h6 align=center><xref table="Named Characters in <I>od</i>"></xref>Table: Named Characters in <i>od</i></h6><dl><dt><b>Note:</b><dd>The<b>\012</b>value may be written either as<b>lf</b>or<b>nl</b>.</dl><p>The type specifier charactercspecifies that bytes will be interpretedas characters specified by the current setting of the LC_CTYPE locale category.Characters listed in the table inthe <b>XBD</b> specification, <a href="../xbd/notation.html"><b>File Format Notation</b> </a> (\\,\a,\b,\f,\n,\r,\t,\v)will be written asthe corresponding escape sequences, except that backslash will bewritten as a single backslashand a NUL will be written as\0.Other non-printable characters will bewritten as one three-digit octal numberfor each byte in the character.If the size of a byte on the system is greater than nine bits,the format used for non-printable characters is implementation-dependent.Printable multi-byte characters will be writtenin the area corresponding to the first byte of the character; thetwo-character sequence**will be written in the area corresponding toeach remaining byte in the character, as an indication that the characteris continued.When either the<b>-j</b> <i>skip</i>or<b>-N</b> <i>count</i>option is specified along with thectype specifier, and this results in an attempt to start or finishin the middle of a multi-byte character, the result isimplementation-dependent.<p>The input data is manipulated in blocks, where a block is definedas a multiple of the least common multiple of the number of bytestransformed by the specified output types.If the least common multipleis greater than 16, the results are unspecified.Each input block will be writtenas transformed by each output type, one per written line, inthe order that the output types were specified.If the input block sizeis larger than the number of bytes transformed by the output type, theoutput type will sequentially transform the parts of the input block, andthe output from each of the transformations will be separated by one ormoreblank characters.<p>If, as a result of the specification of the<b>-N</b>option or end-of-filebeing reached on the last input file,input data only partially satisfiesan output type, the input will be extended sufficiently with null bytesto write the last byte of the input.<p>Unless<b>-A n</b>is specified, the first output line produced for each inputblock will be preceded by the input offset, cumulative across inputfiles, of the next byte to be written.The format of the input offsetis unspecified;however, it will not contain anyblank characters,will start at thefirst character of the output line, and will befollowed by one or moreblank characters.In addition, the offset of the byte following the last byte writtenwill be written after all the input data has been processed, but will notbe followed by anyblank characters.<p>If no<b>-A</b>option is specified, the input offset base is unspecified.</blockquote><h4><a name = "tag_001_014_1606"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>All input files were processed successfully.<dt>>0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_1607"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1608"> </a>APPLICATION USAGE</h4><blockquote>Applications arewarned not to use filenames starting with + or a first operandstarting with a numeric character so that the old functionalitycan be maintained by implementations,unless they specify one of the new options specified by the ISO/IEC 9945-2:1993 standard.To guarantee that one of thesefilenames will always be interpreted as a filename, anapplication could always specify the address base format with the<b>-A</b>option.</blockquote><h4><a name = "tag_001_014_1609"> </a>EXAMPLES</h4><blockquote>If a file containing 128 bytes with decimal values zero to127, in increasing order, is supplied as standard input to the command:<pre><code>od -A d -t a</code></pre>on an implementation using an input block size of 16 bytes, thestandard output, independent of the current locale setting,would be similar to:<pre><code>0000000 nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si0000016 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us0000032 sp ! " # $ % & ' ( ) * + , - . /0000048 0 1 2 3 4 5 6 7 8 9 : ; < = > ?0000064 @ A B C D E F G H I J K L M N O0000080 P Q R S T U V W X Y Z [ \ ] ^ _0000096 ` a b c d e f g h i j k l m n o0000112 p q r s t u v w x y z { | } ~ del0000128</code></pre><p>Note that this specification allows<b>nl</b>or<b>lf</b>to be used as the name for the ISO/IEC 646:1991 standardIRV character with decimal value 10.The IRV names this character<b>lf</b>(line feed), but traditionalimplementations have referred to thischaracter as newline(nl)and the POSIX locale character setsymbolic name for the corresponding character is anewline character.<p>The command:<pre><code>od -A o -t o2x2x -n 18</code></pre>on a system with 32-bit words and an implementation using an input blocksize of 16 bytes could write 18 bytes in approximately the following format:<pre><code>0000000 032056 031440 041123 042040 052516 044530 020043 031464 342e 3320 4253 4420 554e 4958 2023 3334 342e3320 42534420 554e4958 202333340000020 032472 353a 353a00000000022</code></pre><p>The command:<pre><code>od -A d -t f -t o4 -t x4 -n 24 -j 0x15</code></pre>on a system with 64-bit doubles (for example, the IEEE Std. 754 doubleprecision floating-point format) would skip 21 bytes of input data andthen write 24 bytes in approximately the following format:<pre><code>0000000 1.00000000000000e+00 1.57350000000000e+01 07774000000 00000000000 10013674121 35341217270 3ff00000 00000000 402f3851 eb851eb80000016 1.40668230000000e+02 10030312542 04370303230 40619562 23e186980000024</code></pre></blockquote><h4><a name = "tag_001_014_1610"> </a>FUTURE DIRECTIONS</h4><blockquote>All option and operand interfaces marked as extensions may bewithdrawn in a future issue.<p>The IEEE PASC 1003.2 Interpretations Committee has forwarded concerns aboutparts of this interface definition to the IEEE PASC 1003.2 Interpretations Committeewhich is identifying the corrections.A future revision of this specification will align withIEEE Std. 1003.2b when finalised.</blockquote><h4><a name = "tag_001_014_1611"> </a>SEE ALSO</h4><blockquote><i><a href="sed.html">sed</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -