Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
od.html (41016B)
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>od</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/nohup.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/paste.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="od" id="od"></a> <a name="tag_20_90" id="tag_20_90"></a><!-- od --> 29 <h4 class="mansect"><a name="tag_20_90_01" id="tag_20_90_01"></a>NAME</h4> 30 <blockquote>od — dump files in various formats</blockquote> 31 <h4 class="mansect"><a name="tag_20_90_02" id="tag_20_90_02"></a>SYNOPSIS</h4> 32 <blockquote class="synopsis"> 33 <p><code><tt>od</tt> <b>[</b><tt>-v</tt><b>] [</b><tt>-A</tt> <i>address_base</i><b>] [</b><tt>-j</tt> <i>skip</i><b>] [</b><tt>-N</tt> 34 <i>count</i><b>] [</b><tt>-t</tt> <i>type_string</i><b>]</b><tt>...<br> 35 </tt> <b>[</b><i>file</i><tt>...</tt><b>]</b> <tt><br> 36 <br></tt></code></p> 37 <div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt= 38 "[Option Start]" border="0"> od</tt> <b>[</b><tt>-bcdosx</tt><b>] [</b><i>file</i><b>] 39 [[</b><tt>+</tt><b>]</b><i>offset</i><b>[</b><tt>.</tt><b>][</b><tt>b</tt><b>]]</b> <tt><img src="../images/opt-end.gif" alt= 40 "[Option End]" border="0"></tt></code></div> 41 <tt><br></tt></blockquote> 42 <h4 class="mansect"><a name="tag_20_90_03" id="tag_20_90_03"></a>DESCRIPTION</h4> 43 <blockquote> 44 <p>The <i>od</i> utility shall write the contents of its input files to standard output in a user-specified format.</p> 45 </blockquote> 46 <h4 class="mansect"><a name="tag_20_90_04" id="tag_20_90_04"></a>OPTIONS</h4> 47 <blockquote> 48 <p>The <i>od</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 49 Guidelines</i></a> , except that the order of presentation of the <b>-t</b> options <sup>[<a href= 50 "javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> and the 51 <b>-bcdosx</b> options <img src="../images/opt-end.gif" alt="[Option End]" border="0"> is significant.</p> 52 <p>The following options shall be supported:</p> 53 <dl compact> 54 <dd></dd> 55 <dt><b>-A </b><i>address_base</i></dt> 56 <dd><br> 57 Specify the input offset base. See the EXTENDED DESCRIPTION section. The application shall ensure that the <i>address_base</i> 58 option-argument is a character. The characters <tt>'d'</tt>, <tt>'o'</tt>, and <tt>'x'</tt> specify that the offset base shall be 59 written in decimal, octal, or hexadecimal, respectively. The character <tt>'n'</tt> specifies that the offset shall not be 60 written.</dd> 61 <dt><b>-b</b></dt> 62 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 63 Interpret bytes in octal. This shall be equivalent to <b>-t o1</b>. <img src="../images/opt-end.gif" alt="[Option End]" 64 border="0"></dd> 65 <dt><b>-c</b></dt> 66 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 67 Interpret bytes as characters specified by the current setting of the <i>LC_CTYPE</i> category. Certain non-graphic characters 68 appear as C escapes: <tt>"NUL=\0"</tt>, <tt>"BS=\b"</tt>, <tt>"FF=\f"</tt>, <tt>"NL=\n"</tt>, <tt>"CR=\r"</tt>, <tt>"HT=\t"</tt>; 69 others appear as 3-digit octal numbers. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd> 70 <dt><b>-d</b></dt> 71 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 72 Interpret <i>word</i>s (two-byte units) in unsigned decimal. This shall be equivalent to <b>-t u2</b>. <img src= 73 "../images/opt-end.gif" alt="[Option End]" border="0"></dd> 74 <dt><b>-j </b><i>skip</i></dt> 75 <dd>Jump over <i>skip</i> bytes from the beginning of the input. The <i>od</i> utility shall read or seek past the first 76 <i>skip</i> bytes in the concatenated input files. If the combined input is not at least <i>skip</i> bytes long, the <i>od</i> 77 utility shall write a diagnostic message to standard error and exit with a non-zero exit status. 78 <p>By default, the <i>skip</i> option-argument shall be interpreted as a decimal number. With a leading 0x or 0X, the offset shall 79 be interpreted as a hexadecimal number; otherwise, with a leading <tt>'0'</tt>, the offset shall be interpreted as an octal number. 80 Appending the character <tt>'b'</tt>, <tt>'k'</tt>, or <tt>'m'</tt> to offset shall cause it to be interpreted as a multiple of 81 512, 1024, or 1048576 bytes, respectively. If the <i>skip</i> number is hexadecimal, any appended <tt>'b'</tt> shall be considered 82 to be the final hexadecimal digit.</p> 83 </dd> 84 <dt><b>-N </b><i>count</i></dt> 85 <dd>Format no more than <i>count</i> bytes of input. By default, <i>count</i> shall be interpreted as a decimal number. With a 86 leading 0x or 0X, <i>count</i> shall be interpreted as a hexadecimal number; otherwise, with a leading <tt>'0'</tt>, it shall be 87 interpreted as an octal number. If <i>count</i> bytes of input (after successfully skipping, if <b>-j</b> <i>skip</i> is specified) 88 are not available, it shall not be considered an error; the <i>od</i> utility shall format the input that is available.</dd> 89 <dt><b>-o</b></dt> 90 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 91 Interpret <i>word</i>s (two-byte units) in octal. This shall be equivalent to <b>-t o2</b>. <img src="../images/opt-end.gif" 92 alt="[Option End]" border="0"></dd> 93 <dt><b>-s</b></dt> 94 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 95 Interpret <i>word</i>s (two-byte units) in signed decimal. This shall be equivalent to <b>-t d2</b>. <img src= 96 "../images/opt-end.gif" alt="[Option End]" border="0"></dd> 97 <dt><b>-t </b><i>type_string</i></dt> 98 <dd><br> 99 Specify one or more output types. See the EXTENDED DESCRIPTION section. The application shall ensure that the <i>type_string</i> 100 option-argument is a string specifying the types to be used when writing the input data. The string shall consist of the type 101 specification characters <tt>a</tt>, <tt>c</tt>, <tt>d</tt>, <tt>f</tt>, <tt>o</tt>, <tt>u</tt>, and <tt>x</tt>, specifying named 102 character, character, signed decimal, floating point, octal, unsigned decimal, and hexadecimal, respectively. The type 103 specification characters <tt>d</tt>, <tt>f</tt>, <tt>o</tt>, <tt>u</tt>, and <tt>x</tt> can be followed by an optional unsigned 104 decimal integer that specifies the number of bytes to be transformed by each instance of the output type. The type specification 105 character <tt>f</tt> can be followed by an optional <tt>F</tt>, <tt>D</tt>, or <tt>L</tt> indicating that the conversion should be 106 applied to an item of type <b>float</b>, <b>double</b>, or <b>long double</b>, respectively. The type specification characters 107 <tt>d</tt>, <tt>o</tt>, <tt>u</tt>, and <tt>x</tt> can be followed by an optional <tt>C</tt>, <tt>S</tt>, <tt>I</tt>, or <tt>L</tt> 108 indicating that the conversion should be applied to an item of type <b>char</b>, <b>short</b>, <b>int</b>, or <b>long</b>, 109 respectively. Multiple types can be concatenated within the same <i>type_string</i> and multiple <b>-t</b> options can be 110 specified. Output lines shall be written for each type specified in the order in which the type specification characters are 111 specified.</dd> 112 <dt><b>-v</b></dt> 113 <dd>Write all input data. Without the <b>-v</b> option, any number of groups of output lines, which would be identical to the 114 immediately preceding group of output lines (except for the byte offsets), shall be replaced with a line containing only an 115 <asterisk> (<tt>'*'</tt>).</dd> 116 <dt><b>-x</b></dt> 117 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 118 Interpret <i>word</i>s (two-byte units) in hexadecimal. This shall be equivalent to <b>-t x2</b>. <img src= 119 "../images/opt-end.gif" alt="[Option End]" border="0"></dd> 120 </dl> 121 <p><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 122 Multiple types can be specified by using multiple <b>-bcdostx</b> options. Output lines are written for each type specified in the 123 order in which the types are specified. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p> 124 </blockquote> 125 <h4 class="mansect"><a name="tag_20_90_05" id="tag_20_90_05"></a>OPERANDS</h4> 126 <blockquote> 127 <p>The following operands shall be supported:</p> 128 <dl compact> 129 <dd></dd> 130 <dt><i>file</i></dt> 131 <dd>A pathname of a file to be read. If no <i>file</i> operands are specified, the standard input shall be used. 132 <p>If there are no more than two operands, none of the <b>-A</b>, <b>-j</b>, <b>-N</b>, <b>-t</b>, or <b>-v</b> options is 133 specified, and either of the following is true: the first character of the last operand is a <plus-sign> (<tt>'+'</tt>), or 134 there are two operands and the first character of the last operand is numeric; <sup>[<a href= 135 "javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> the last 136 operand shall be interpreted as an offset operand on XSI-conformant systems. <img src="../images/opt-end.gif" alt="[Option End]" 137 border="0"> Under these conditions, the results are unspecified on systems that are not XSI-conformant systems.</p> 138 </dd> 139 <dt><b>[+]</b><i>offset</i><b>[.][b]</b></dt> 140 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 141 The <i>offset</i> operand specifies the offset in the file where dumping is to commence. This operand is normally interpreted as 142 octal bytes. If <tt>'.'</tt> is appended, the offset shall be interpreted in decimal. If <tt>'b'</tt> is appended, the offset shall 143 be interpreted in units of 512 bytes. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd> 144 </dl> 145 </blockquote> 146 <h4 class="mansect"><a name="tag_20_90_06" id="tag_20_90_06"></a>STDIN</h4> 147 <blockquote> 148 <p>The standard input shall be used if no <i>file</i> operands are specified, and shall be used if a <i>file</i> operand is 149 <tt>'-'</tt> and the implementation treats the <tt>'-'</tt> as meaning standard input. Otherwise, the standard input shall not be 150 used. See the INPUT FILES section.</p> 151 </blockquote> 152 <h4 class="mansect"><a name="tag_20_90_07" id="tag_20_90_07"></a>INPUT FILES</h4> 153 <blockquote> 154 <p>The input files can be any file type.</p> 155 </blockquote> 156 <h4 class="mansect"><a name="tag_20_90_08" id="tag_20_90_08"></a>ENVIRONMENT VARIABLES</h4> 157 <blockquote> 158 <p>The following environment variables shall affect the execution of <i>od</i>:</p> 159 <dl compact> 160 <dd></dd> 161 <dt><i>LANG</i></dt> 162 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 163 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 164 variables used to determine the values of locale categories.)</dd> 165 <dt><i>LC_ALL</i></dt> 166 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 167 <dt><i>LC_CTYPE</i></dt> 168 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 169 opposed to multi-byte characters in arguments and input files).</dd> 170 <dt><i>LC_MESSAGES</i></dt> 171 <dd><br> 172 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 173 <dt><i>LC_NUMERIC</i></dt> 174 <dd><br> 175 Determine the locale for selecting the radix character used when writing floating-point formatted output.</dd> 176 <dt><i>NLSPATH</i></dt> 177 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 178 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 179 "0"></dd> 180 </dl> 181 </blockquote> 182 <h4 class="mansect"><a name="tag_20_90_09" id="tag_20_90_09"></a>ASYNCHRONOUS EVENTS</h4> 183 <blockquote> 184 <p>Default.</p> 185 </blockquote> 186 <h4 class="mansect"><a name="tag_20_90_10" id="tag_20_90_10"></a>STDOUT</h4> 187 <blockquote> 188 <p>See the EXTENDED DESCRIPTION section.</p> 189 </blockquote> 190 <h4 class="mansect"><a name="tag_20_90_11" id="tag_20_90_11"></a>STDERR</h4> 191 <blockquote> 192 <p>The standard error shall be used only for diagnostic messages.</p> 193 </blockquote> 194 <h4 class="mansect"><a name="tag_20_90_12" id="tag_20_90_12"></a>OUTPUT FILES</h4> 195 <blockquote> 196 <p>None.</p> 197 </blockquote> 198 <h4 class="mansect"><a name="tag_20_90_13" id="tag_20_90_13"></a>EXTENDED DESCRIPTION</h4> 199 <blockquote> 200 <p>The <i>od</i> utility shall copy sequentially each input file to standard output, transforming the input data according to the 201 output types specified by the <b>-t</b> option <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src= 202 "../images/opt-start.gif" alt="[Option Start]" border="0"> or the <b>-bcdosx</b> options. <img src="../images/opt-end.gif" 203 alt="[Option End]" border="0"> If no output type is specified, the default output shall be as if <b>-t oS</b> had been 204 specified.</p> 205 <p>The number of bytes transformed by the output type specifier <tt>c</tt> may be variable depending on the <i>LC_CTYPE</i> 206 category.</p> 207 <p>The default number of bytes transformed by output type specifiers <tt>d</tt>, <tt>f</tt>, <tt>o</tt>, <tt>u</tt>, and <tt>x</tt> 208 corresponds to the various C-language types as follows. If the <a href="../utilities/c17.html"><i>c17</i></a> compiler is present 209 on the system, these specifiers shall correspond to the sizes used by default in that compiler. Otherwise, these sizes may vary 210 among systems that conform to POSIX.1-2024.</p> 211 <ul> 212 <li> 213 <p>For the type specifier characters <tt>d</tt>, <tt>o</tt>, <tt>u</tt>, and <tt>x</tt>, the default number of bytes shall 214 correspond to the size of the underlying implementation's basic integer type. For these specifier characters, the implementation 215 shall support values of the optional number of bytes to be converted corresponding to the number of bytes in the C-language types 216 <b>char</b>, <b>short</b>, <b>int</b>, and <b>long</b>. These numbers can also be specified by an application as the characters 217 <tt>'C'</tt>, <tt>'S'</tt>, <tt>'I'</tt>, and <tt>'L'</tt>, respectively. The implementation shall also support the values 1, 2, 4, 218 and 8, even if it provides no C-Language types of those sizes. The implementation shall support the decimal value corresponding to 219 the C-language type <b>long long</b>. The byte order used when interpreting numeric values is implementation-defined, but shall 220 correspond to the order in which a constant of the corresponding type is stored in memory on the system.</p> 221 </li> 222 <li> 223 <p>For the type specifier character <tt>f</tt>, the default number of bytes shall correspond to the number of bytes in the 224 underlying implementation's basic double precision floating-point data type. The implementation shall support values of the 225 optional number of bytes to be converted corresponding to the number of bytes in the C-language types <b>float,</b> <b>double</b>, 226 and <b>long double</b>. These numbers can also be specified by an application as the characters <tt>'F'</tt>, <tt>'D'</tt>, and 227 <tt>'L'</tt>, respectively.</p> 228 </li> 229 </ul> 230 <p>The type specifier character <tt>a</tt> specifies that bytes shall be interpreted as named characters from the International 231 Reference Version (IRV) of the ISO/IEC 646:1991 standard. Only the least significant seven bits of each byte shall be used for 232 this type specification. Bytes with the values listed in the following table shall be written using the corresponding names for 233 those characters.<br></p> 234 <p class="caption">Table: Named Characters in <i>od</i></p> 235 <center> 236 <table border="1" cellpadding="3" align="center"> 237 <tr valign="top"> 238 <th align="center"> 239 <p class="tent"><b>Value</b></p> 240 </th> 241 <th align="center"> 242 <p class="tent"><b>Name</b></p> 243 </th> 244 <th align="center"> 245 <p class="tent"><b>Value</b></p> 246 </th> 247 <th align="center"> 248 <p class="tent"><b>Name</b></p> 249 </th> 250 <th align="center"> 251 <p class="tent"><b>Value</b></p> 252 </th> 253 <th align="center"> 254 <p class="tent"><b>Name</b></p> 255 </th> 256 <th align="center"> 257 <p class="tent"><b>Value</b></p> 258 </th> 259 <th align="center"> 260 <p class="tent"><b>Name</b></p> 261 </th> 262 </tr> 263 <tr valign="top"> 264 <td align="left"> 265 <p class="tent">\000</p> 266 </td> 267 <td align="left"> 268 <p class="tent"><b>nul</b></p> 269 </td> 270 <td align="left"> 271 <p class="tent">\001</p> 272 </td> 273 <td align="left"> 274 <p class="tent"><b>soh</b></p> 275 </td> 276 <td align="left"> 277 <p class="tent">\002</p> 278 </td> 279 <td align="left"> 280 <p class="tent"><b>stx</b></p> 281 </td> 282 <td align="left"> 283 <p class="tent">\003</p> 284 </td> 285 <td align="left"> 286 <p class="tent"><b>etx</b></p> 287 </td> 288 </tr> 289 <tr valign="top"> 290 <td align="left"> 291 <p class="tent">\004</p> 292 </td> 293 <td align="left"> 294 <p class="tent"><b>eot</b></p> 295 </td> 296 <td align="left"> 297 <p class="tent">\005</p> 298 </td> 299 <td align="left"> 300 <p class="tent"><b>enq</b></p> 301 </td> 302 <td align="left"> 303 <p class="tent">\006</p> 304 </td> 305 <td align="left"> 306 <p class="tent"><b>ack</b></p> 307 </td> 308 <td align="left"> 309 <p class="tent">\007</p> 310 </td> 311 <td align="left"> 312 <p class="tent"><b>bel</b></p> 313 </td> 314 </tr> 315 <tr valign="top"> 316 <td align="left"> 317 <p class="tent">\010</p> 318 </td> 319 <td align="left"> 320 <p class="tent"><b>bs</b></p> 321 </td> 322 <td align="left"> 323 <p class="tent">\011</p> 324 </td> 325 <td align="left"> 326 <p class="tent"><b>ht</b></p> 327 </td> 328 <td align="left"> 329 <p class="tent">\012</p> 330 </td> 331 <td align="left"> 332 <p class="tent"><b>lf or nl<sup><small>*</small></sup></b></p> 333 </td> 334 <td align="left"> 335 <p class="tent">\013</p> 336 </td> 337 <td align="left"> 338 <p class="tent"><b>vt</b></p> 339 </td> 340 </tr> 341 <tr valign="top"> 342 <td align="left"> 343 <p class="tent">\014</p> 344 </td> 345 <td align="left"> 346 <p class="tent"><b>ff</b></p> 347 </td> 348 <td align="left"> 349 <p class="tent">\015</p> 350 </td> 351 <td align="left"> 352 <p class="tent"><b>cr</b></p> 353 </td> 354 <td align="left"> 355 <p class="tent">\016</p> 356 </td> 357 <td align="left"> 358 <p class="tent"><b>so</b></p> 359 </td> 360 <td align="left"> 361 <p class="tent">\017</p> 362 </td> 363 <td align="left"> 364 <p class="tent"><b>si</b></p> 365 </td> 366 </tr> 367 <tr valign="top"> 368 <td align="left"> 369 <p class="tent">\020</p> 370 </td> 371 <td align="left"> 372 <p class="tent"><b>dle</b></p> 373 </td> 374 <td align="left"> 375 <p class="tent">\021</p> 376 </td> 377 <td align="left"> 378 <p class="tent"><b>dc1</b></p> 379 </td> 380 <td align="left"> 381 <p class="tent">\022</p> 382 </td> 383 <td align="left"> 384 <p class="tent"><b>dc2</b></p> 385 </td> 386 <td align="left"> 387 <p class="tent">\023</p> 388 </td> 389 <td align="left"> 390 <p class="tent"><b>dc3</b></p> 391 </td> 392 </tr> 393 <tr valign="top"> 394 <td align="left"> 395 <p class="tent">\024</p> 396 </td> 397 <td align="left"> 398 <p class="tent"><b>dc4</b></p> 399 </td> 400 <td align="left"> 401 <p class="tent">\025</p> 402 </td> 403 <td align="left"> 404 <p class="tent"><b>nak</b></p> 405 </td> 406 <td align="left"> 407 <p class="tent">\026</p> 408 </td> 409 <td align="left"> 410 <p class="tent"><b>syn</b></p> 411 </td> 412 <td align="left"> 413 <p class="tent">\027</p> 414 </td> 415 <td align="left"> 416 <p class="tent"><b>etb</b></p> 417 </td> 418 </tr> 419 <tr valign="top"> 420 <td align="left"> 421 <p class="tent">\030</p> 422 </td> 423 <td align="left"> 424 <p class="tent"><b>can</b></p> 425 </td> 426 <td align="left"> 427 <p class="tent">\031</p> 428 </td> 429 <td align="left"> 430 <p class="tent"><b>em</b></p> 431 </td> 432 <td align="left"> 433 <p class="tent">\032</p> 434 </td> 435 <td align="left"> 436 <p class="tent"><b>sub</b></p> 437 </td> 438 <td align="left"> 439 <p class="tent">\033</p> 440 </td> 441 <td align="left"> 442 <p class="tent"><b>esc</b></p> 443 </td> 444 </tr> 445 <tr valign="top"> 446 <td align="left"> 447 <p class="tent">\034</p> 448 </td> 449 <td align="left"> 450 <p class="tent"><b>fs</b></p> 451 </td> 452 <td align="left"> 453 <p class="tent">\035</p> 454 </td> 455 <td align="left"> 456 <p class="tent"><b>gs</b></p> 457 </td> 458 <td align="left"> 459 <p class="tent">\036</p> 460 </td> 461 <td align="left"> 462 <p class="tent"><b>rs</b></p> 463 </td> 464 <td align="left"> 465 <p class="tent">\037</p> 466 </td> 467 <td align="left"> 468 <p class="tent"><b>us</b></p> 469 </td> 470 </tr> 471 <tr valign="top"> 472 <td align="left"> 473 <p class="tent">\040</p> 474 </td> 475 <td align="left"> 476 <p class="tent"><b>sp</b></p> 477 </td> 478 <td align="left"> 479 <p class="tent">\177</p> 480 </td> 481 <td align="left"> 482 <p class="tent"><b>del</b></p> 483 </td> 484 <td align="left"> 485 <p class="tent"> </p> 486 </td> 487 <td align="left"> 488 <p class="tent"><b> </b></p> 489 </td> 490 <td align="left"> 491 <p class="tent"> </p> 492 </td> 493 <td align="left"> 494 <p class="tent"><b> </b></p> 495 </td> 496 </tr> 497 </table> 498 </center> 499 <basefont size="2"> 500 <dl> 501 <dt><b>Note:</b></dt> 502 <dd>The <tt>"\012"</tt> value may be written either as <b>lf</b> or <b>nl</b>.</dd> 503 </dl> 504 <basefont size="3"> 505 <p class="tent">The type specifier character <tt>c</tt> specifies that bytes shall be interpreted as characters specified by the 506 current setting of the <i>LC_CTYPE</i> locale category. Characters listed in the table in XBD <a href= 507 "../basedefs/V1_chap05.html#tag_05"><i>5. File Format Notation</i></a> (<tt>'\\'</tt>, <tt>'\a'</tt>, <tt>'\b'</tt>, <tt>'\f'</tt>, 508 <tt>'\n'</tt>, <tt>'\r'</tt>, <tt>'\t'</tt>, <tt>'\v'</tt>) shall be written as the corresponding escape sequences, except that 509 <backslash> shall be written as a single <backslash> and a NUL shall be written as <tt>'\0'</tt>. Other non-printable 510 characters shall be written as one three-digit octal number for each byte in the character. Printable multi-byte characters shall 511 be written in the area corresponding to the first byte of the character; the two-character sequence <tt>"**"</tt> shall be written 512 in the area corresponding to each remaining byte in the character, as an indication that the character is continued. When either 513 the <b>-j</b> <i>skip</i> or <b>-N</b> <i>count</i> option is specified along with the <tt>c</tt> type specifier, and this results 514 in an attempt to start or finish in the middle of a multi-byte character, the result is implementation-defined.</p> 515 <p class="tent">The input data shall be manipulated in blocks, where a block is defined as a multiple of the least common multiple 516 of the number of bytes transformed by the specified output types. If the least common multiple is greater than 16, the results are 517 unspecified. Each input block shall be written as transformed by each output type, one per written line, in the order that the 518 output types were specified. If the input block size is larger than the number of bytes transformed by the output type, the output 519 type shall sequentially transform the parts of the input block, and the output from each of the transformations shall be separated 520 by one or more <blank> characters.</p> 521 <p class="tent">If, as a result of the specification of the <b>-N</b> option or end-of-file being reached on the last input file, 522 input data only partially satisfies an output type, the input shall be extended sufficiently with null bytes to write the last byte 523 of the input.</p> 524 <p class="tent">Unless <b>-A n</b> is specified, the first output line produced for each input block shall be preceded by the 525 input offset, cumulative across input files, of the next byte to be written. The format of the input offset is unspecified; 526 however, it shall not contain any <blank> characters, shall start at the first character of the output line, and shall be 527 followed by one or more <blank> characters. In addition, the offset of the byte following the last byte written shall be 528 written after all the input data has been processed, but shall not be followed by any <blank> characters. If <b>-A n</b> 529 is specified, it is unspecified whether the line that would contain this final offset is written as an empty line or is not 530 written.</p> 531 <p class="tent">If no <b>-A</b> option is specified, the input offset base is unspecified.</p> 532 </blockquote> 533 <h4 class="mansect"><a name="tag_20_90_14" id="tag_20_90_14"></a>EXIT STATUS</h4> 534 <blockquote> 535 <p>The following exit values shall be returned:</p> 536 <dl compact> 537 <dd></dd> 538 <dt> 0</dt> 539 <dd>All input files were processed successfully.</dd> 540 <dt>>0</dt> 541 <dd>An error occurred.</dd> 542 </dl> 543 </blockquote> 544 <h4 class="mansect"><a name="tag_20_90_15" id="tag_20_90_15"></a>CONSEQUENCES OF ERRORS</h4> 545 <blockquote> 546 <p>Default.</p> 547 </blockquote> 548 <hr> 549 <div class="box"><em>The following sections are informative.</em></div> 550 <h4 class="mansect"><a name="tag_20_90_16" id="tag_20_90_16"></a>APPLICATION USAGE</h4> 551 <blockquote> 552 <p>XSI-conformant applications are warned not to use filenames starting with <tt>'+'</tt> or a first operand starting with a 553 numeric character so that the old functionality can be maintained by implementations, unless they specify one of the <b>-A</b>, 554 <b>-j</b>, or <b>-N</b> options. To guarantee that one of these filenames is always interpreted as a filename, an application could 555 always specify the address base format with the <b>-A</b> option.</p> 556 </blockquote> 557 <h4 class="mansect"><a name="tag_20_90_17" id="tag_20_90_17"></a>EXAMPLES</h4> 558 <blockquote> 559 <p>If a file containing 128 bytes with decimal values zero to 127, in increasing order, is supplied as standard input to the 560 command:</p> 561 <pre> 562 <tt>od -A d -t a 563 </tt></pre> 564 <p class="tent">on an implementation using an input block size of 16 bytes, the standard output, independent of the current locale 565 setting, would be similar to:</p> 566 <pre> 567 <tt>0000000 nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si 568 0000016 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us 569 0000032 sp ! " # $ % & ' ( ) * + , - . / 570 0000048 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 571 0000064 @ A B C D E F G H I J K L M N O 572 0000080 P Q R S T U V W X Y Z [ \ ] ^ _ 573 0000096 ` a b c d e f g h i j k l m n o 574 0000112 p q r s t u v w x y z { | } ~ del 575 0000128 576 </tt></pre> 577 <p class="tent">Note that this volume of POSIX.1-2024 allows <b>nl</b> or <b>lf</b> to be used as the name for the 578 ISO/IEC 646:1991 standard IRV character with decimal value 10. The IRV names this character <b>lf</b> (line feed), but 579 traditional implementations have referred to this character as newline (<b>nl</b>) and the POSIX locale character set symbolic name 580 for the corresponding character is a <newline>.</p> 581 <p class="tent">The command:</p> 582 <pre> 583 <tt>od -A o -t o2x2x -N 18 584 </tt></pre> 585 <p class="tent">on a system with 32-bit words and an implementation using an input block size of 16 bytes could write 18 bytes in 586 approximately the following format:</p> 587 <pre> 588 <tt>0000000 032056 031440 041123 042040 052516 044530 020043 031464 589 342e 3320 4253 4420 554e 4958 2023 3334 590 342e3320 42534420 554e4958 20233334 591 0000020 032472 592 353a 593 353a0000 594 0000022 595 </tt></pre> 596 <p class="tent">The command:</p> 597 <pre> 598 <tt>od -A d -t f -t o4 -t x4 -N 24 -j 0x15 599 </tt></pre> 600 <p class="tent">on a system with 64-bit doubles (for example, IEEE Std 754-1985 double precision floating-point format) 601 would skip 21 bytes of input data and then write 24 bytes in approximately the following format:</p> 602 <pre> 603 <tt>0000000 1.00000000000000e+00 1.57350000000000e+01 604 07774000000 00000000000 10013674121 35341217270 605 3ff00000 00000000 402f3851 eb851eb8 606 0000016 1.40668230000000e+02 607 10030312542 04370303230 608 40619562 23e18698 609 0000024 610 </tt></pre></blockquote> 611 <h4 class="mansect"><a name="tag_20_90_18" id="tag_20_90_18"></a>RATIONALE</h4> 612 <blockquote> 613 <p>The <i>od</i> utility went through several names in early proposals, including <i>hd</i>, <i>xd</i>, and most recently 614 <i>hexdump</i>. There were several objections to all of these based on the following reasons:</p> 615 <ul> 616 <li class="tent">The <i>hd</i> and <i>xd</i> names conflicted with historical utilities that behaved differently.</li> 617 <li class="tent">The <i>hexdump</i> description was much more complex than needed for a simple dump utility.</li> 618 <li class="tent">The <i>od</i> utility has been available on all historical implementations and there was no need to create a new 619 name for a utility so similar to the historical <i>od</i> utility.</li> 620 </ul> 621 <p class="tent">The original reasons for not standardizing historical <i>od</i> were also fairly widespread. Those reasons are 622 given below along with rationale explaining why the standard developers believe that this version does not suffer from the 623 indicated problem:</p> 624 <ul> 625 <li class="tent">The BSD and System V versions of <i>od</i> have diverged, and the intersection of features provided by both does 626 not meet the needs of the user community. In fact, the System V version only provides a mechanism for dumping octal bytes and 627 <b>short</b>s, signed and unsigned decimal <b>short</b>s, hexadecimal <b>short</b>s, and ASCII characters. BSD added the ability to 628 dump <b>float</b>s, <b>double</b>s, named ASCII characters, and octal, signed decimal, unsigned decimal, and hexadecimal 629 <b>long</b>s. The version presented here provides more normalized forms for dumping bytes, <b>short</b>s, <b>int</b>s, and 630 <b>long</b>s in octal, signed decimal, unsigned decimal, and hexadecimal; <b>float</b>, <b>double</b>, and <b>long double</b>; and 631 named ASCII as well as current locale characters.</li> 632 <li class="tent">It would not be possible to come up with a compatible superset of the BSD and System V flags that met the 633 requirements of the standard developers. The historical default <i>od</i> output is the specified default output of this utility. 634 None of the option letters chosen for this version of <i>od</i> conflict with any of the options to historical versions of 635 <i>od</i>.</li> 636 <li class="tent">On systems with different sizes for <b>short</b>, <b>int</b>, and <b>long</b>, there was no way to ask for dumps 637 of <b>int</b>s, even in the BSD version. Because of the way options are named, the name space could not be extended to solve these 638 problems. This is why the <b>-t</b> option was added (with type specifiers more closely matched to the <a href= 639 "../functions/printf.html"><i>printf</i>()</a> formats used in the rest of this volume of POSIX.1-2024) and the optional field 640 sizes were added to the <tt>d</tt>, <tt>f</tt>, <tt>o</tt>, <tt>u</tt>, and <tt>x</tt> type specifiers. It is also one of the 641 reasons why the historical practice was not mandated as a required obsolescent form of <i>od</i>. (Although the old versions of 642 <i>od</i> are not listed as an obsolescent form, implementations are urged to continue to recognize the older forms for several 643 more years.) The <tt>a</tt>, <tt>c</tt>, <tt>f</tt>, <tt>o</tt>, and <tt>x</tt> types match the meaning of the corresponding format 644 characters in the historical implementations of <i>od</i> except for the default sizes of the fields converted. The <tt>d</tt> 645 format is signed in this volume of POSIX.1-2024 to match the <a href="../functions/printf.html"><i>printf</i>()</a> notation. 646 (Historical versions of <i>od</i> used <tt>d</tt> as a synonym for <tt>u</tt> in this version. The System V implementation uses 647 <tt>s</tt> for signed decimal; BSD uses <tt>i</tt> for signed decimal and <tt>s</tt> for null-terminated strings.) Other than 648 <tt>d</tt> and <tt>u</tt>, all of the type specifiers match format characters in the historical BSD version of <b>od</b>. 649 <p class="tent">The sizes of the C-language types <b>char</b>, <b>short</b>, <b>int</b>, <b>long</b>, <b>float</b>, <b>double</b>, 650 and <b>long double</b> are used even though it is recognized that there may be zero or more than one compiler for the C language on 651 an implementation and that they may use different sizes for some of these types. (For example, one compiler might use 2 bytes 652 <b>short</b>s, 2 bytes <b>int</b>s, and 4 bytes <b>long</b>s, while another compiler (or an option to the same compiler) uses 2 653 bytes <b>short</b>s, 4 bytes <b>int</b>s, and 4 bytes <b>long</b>s.) Nonetheless, there has to be a basic size known by the 654 implementation for these types, corresponding to the values reported by invocations of the <a href= 655 "../utilities/getconf.html"><i>getconf</i></a> utility when called with <i>system_var</i> operands {UCHAR_MAX}, {USHORT_MAX}, 656 {UINT_MAX}, and {ULONG_MAX} for the types <b>char</b>, <b>short</b>, <b>int</b>, and <b>long</b>, respectively. There are similar 657 constants required by the ISO C standard, but not required by the System Interfaces volume of POSIX.1-2024 or this volume of 658 POSIX.1-2024. They are {FLT_MANT_DIG}, {DBL_MANT_DIG}, and {LDBL_MANT_DIG} for the types <b>float</b>, <b>double</b>, and <b>long 659 double</b>, respectively. If the optional <a href="../utilities/c17.html"><i>c17</i></a> utility is provided by the implementation 660 and used as specified by this volume of POSIX.1-2024, these are the sizes that would be provided. If an option is used that 661 specifies different sizes for these types, there is no guarantee that the <i>od</i> utility is able to interpret binary data output 662 by such a program correctly.</p> 663 <p class="tent">This volume of POSIX.1-2024 requires that the numeric values of these lengths be recognized by the <i>od</i> 664 utility and that symbolic forms also be recognized. Thus, a conforming application can always look at an array of <b>unsigned 665 long</b> data elements using <i>od</i> <b>-t</b> <i>uL</i>.</p> 666 </li> 667 <li class="tent">The method of specifying the format for the address field based on specifying a starting offset in a file 668 unnecessarily tied the two together. The <b>-A</b> option now specifies the address base and the <b>-S</b> option specifies a 669 starting offset.</li> 670 <li class="tent">It would be difficult to break the dependence on US ASCII to achieve an internationalized utility. It does not 671 seem to be any harder for <i>od</i> to dump characters in the current locale than it is for the <a href= 672 "../utilities/ed.html"><i>ed</i></a> or <a href="../utilities/sed.html"><i>sed</i></a> <b>l</b> commands. The <tt>c</tt> type 673 specifier does this without difficulty and is completely compatible with the historical implementations of the <b>c</b> format 674 character when the current locale uses a superset of the ISO/IEC 646:1991 standard as a codeset. The <tt>a</tt> type specifier 675 (from the BSD <b>a</b> format character) was left as a portable means to dump ASCII (or more correctly ISO/IEC 646:1991 676 standard (IRV)) so that headers produced by <a href="../utilities/pax.html"><i>pax</i></a> could be deciphered even on systems that 677 do not use the ISO/IEC 646:1991 standard as a subset of their base codeset.</li> 678 </ul> 679 <p class="tent">The use of <tt>"**"</tt> as an indication of continuation of a multi-byte character in <tt>c</tt> specifier output 680 was chosen based on seeing an implementation that uses this method. The continuation bytes have to be marked in a way that is not 681 ambiguous with another single-byte or multi-byte character.</p> 682 <p class="tent">An early proposal used <b>-S</b> and <b>-n</b>, respectively, for the <b>-j</b> and <b>-N</b> options eventually 683 selected. These were changed to avoid conflicts with historical implementations.</p> 684 <p class="tent">The original standard specified <b>-t o2</b> as the default when no output type was given. This was changed to 685 <b>-t oS</b> (the length of a <b>short</b>) to accommodate a supercomputer implementation that historically used 64 bits as its 686 default (and that defined shorts as 64 bits). This change should not affect conforming applications. The requirement to support 687 lengths of 1, 2, and 4 was added at the same time to address an historical implementation that had no two-byte data types in its C 688 compiler.</p> 689 <p class="tent">The use of a basic integer data type is intended to allow the implementation to choose a word size commonly used by 690 applications on that architecture.</p> 691 <p class="tent">Earlier versions of this standard allowed for implementations with bytes other than eight bits, but this has been 692 modified in this version.</p> 693 </blockquote> 694 <h4 class="mansect"><a name="tag_20_90_19" id="tag_20_90_19"></a>FUTURE DIRECTIONS</h4> 695 <blockquote> 696 <p>All option and operand interfaces marked XSI may be removed in a future version.</p> 697 </blockquote> 698 <h4 class="mansect"><a name="tag_20_90_20" id="tag_20_90_20"></a>SEE ALSO</h4> 699 <blockquote> 700 <p><a href="../utilities/c17.html#"><i>c17</i></a> , <a href="../utilities/sed.html#"><i>sed</i></a></p> 701 <p class="tent">XBD <a href="../basedefs/V1_chap05.html#tag_05"><i>5. File Format Notation</i></a> , <a href= 702 "../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 703 Utility Syntax Guidelines</i></a></p> 704 </blockquote> 705 <h4 class="mansect"><a name="tag_20_90_21" id="tag_20_90_21"></a>CHANGE HISTORY</h4> 706 <blockquote> 707 <p>First released in Issue 2.</p> 708 </blockquote> 709 <h4 class="mansect"><a name="tag_20_90_22" id="tag_20_90_22"></a>Issue 5</h4> 710 <blockquote> 711 <p>In the description of the <b>-c</b> option, the phrase "This is equivalent to <b>-t c</b>." is deleted.</p> 712 <p class="tent">The FUTURE DIRECTIONS section is modified.</p> 713 </blockquote> 714 <h4 class="mansect"><a name="tag_20_90_23" id="tag_20_90_23"></a>Issue 6</h4> 715 <blockquote> 716 <p>The <i>od</i> utility is changed to remove the assumption that <b>short</b> was a two-byte entity, as per the revisions in the 717 IEEE P1003.2b draft standard.</p> 718 <p class="tent">The normative text is reworded to avoid use of the term "must" for application requirements.</p> 719 <p class="tent">IEEE Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/33 is applied, correcting the examples which used 720 an undefined <b>-n</b> option, which should have been <b>-N</b>.</p> 721 <p class="tent">IEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/19 is applied, removing text describing behavior on 722 systems with bytes consisting of more than eight bits.</p> 723 </blockquote> 724 <h4 class="mansect"><a name="tag_20_90_24" id="tag_20_90_24"></a>Issue 7</h4> 725 <blockquote> 726 <p>Austin Group Interpretation 1003.1-2001 #092 is applied.</p> 727 <p class="tent">SD5-XCU-ERN-37 is applied, updating the OPERANDS section.</p> 728 <p class="tent">SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p> 729 </blockquote> 730 <h4 class="mansect"><a name="tag_20_90_25" id="tag_20_90_25"></a>Issue 8</h4> 731 <blockquote> 732 <p>Austin Group Defect 1017 is applied, clarifying that when <b>-A n</b> is specified, the line that would contain the final 733 offset can either be written as an empty line or not be written.</p> 734 <p class="tent">Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 735 </blockquote> 736 <div class="box"><em>End of informative text.</em></div> 737 <hr> 738 <p> </p> 739 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 740 <hr size="2" noshade> 741 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 742 POSIX™ is a Trademark of The IEEE.<br> 743 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 744 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 745 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 746 ]</font></center> 747 <hr size="2" noshade> 748 <div class="NAVHEADER"> 749 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 750 <tr class="nav"> 751 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/nohup.html" accesskey="P"><<< 752 Previous</a></td> 753 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 754 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/paste.html" accesskey="N">Next 755 >>></a></td> 756 </tr> 757 </table> 758 <hr align="left" width="100%"></div> 759 </body> 760 </html>