isposix

Un outil pour savoir si une commande est posix - retour accueil

git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |

val.html (14326B)


      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>val</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/uux.html" accesskey="P">&lt;&lt;&lt;
     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/vi.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
     19 </tr>
     20 </table>
     21 <hr align="left" width="100%"></div>
     22 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3">
     23 <center><font size="2">The Open Group Base Specifications Issue 8<br>
     24 IEEE Std 1003.1-2024<br>
     25 Copyright © 2001-2024 The IEEE and The Open Group</font></center>
     26 <hr size="2" noshade>
     27 <a name="top" id="top"></a> <a name="val" id="val"></a> <a name="tag_20_145" id="tag_20_145"></a><!-- val -->
     28 <h4 class="mansect"><a name="tag_20_145_01" id="tag_20_145_01"></a>NAME</h4>
     29 <blockquote>val — validate SCCS files (<b>DEVELOPMENT</b>)</blockquote>
     30 <h4 class="mansect"><a name="tag_20_145_02" id="tag_20_145_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <div class="box"><code><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt=
     33 "[Option Start]" border="0"> val -<br>
     34 <br>
     35 val</tt> <b>[</b><tt>-s</tt><b>] [</b><tt>-m</tt> <i>name</i><b>] [</b><tt>-r</tt> <i>SID</i><b>] [</b><tt>-y</tt>
     36 <i>type</i><b>]</b> <i>file</i><tt>... <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
     37 <tt><br></tt></blockquote>
     38 <h4 class="mansect"><a name="tag_20_145_03" id="tag_20_145_03"></a>DESCRIPTION</h4>
     39 <blockquote>
     40 <p>The <i>val</i> utility shall determine whether the specified <i>file</i> is an SCCS file meeting the characteristics specified
     41 by the options.</p>
     42 </blockquote>
     43 <h4 class="mansect"><a name="tag_20_145_04" id="tag_20_145_04"></a>OPTIONS</h4>
     44 <blockquote>
     45 <p>The <i>val</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     46 Guidelines</i></a> , except that the usage of the <tt>'-'</tt> operand is not strictly as intended by the guidelines (that is,
     47 reading options and operands from standard input).</p>
     48 <p>The following options shall be supported:</p>
     49 <dl compact>
     50 <dd></dd>
     51 <dt><b>-m&nbsp;</b><i>name</i></dt>
     52 <dd>Specify a <i>name</i>, which is compared with the SCCS %<b>M</b>% keyword in <i>file</i>; see <a href=
     53 "../utilities/get.html#"><i>get</i></a> .</dd>
     54 <dt><b>-r&nbsp;</b><i>SID</i></dt>
     55 <dd>Specify a <i>SID</i> (SCCS Identification String), an SCCS delta number. A check shall be made to determine whether the
     56 <i>SID</i> is ambiguous (for example, <b>-r&nbsp;1</b> is ambiguous because it physically does not exist but implies 1.1, 1.2, and
     57 so on, which may exist) or invalid (for example, <b>-r&nbsp;1.0</b> or <b>-r&nbsp;1.1.0</b> are invalid because neither case can
     58 exist as a valid delta number). If the <i>SID</i> is valid and not ambiguous, a check shall be made to determine whether it
     59 actually exists.</dd>
     60 <dt><b>-s</b></dt>
     61 <dd>Silence the diagnostic message normally written to standard output for any error that is detected while processing each named
     62 file on a given command line.</dd>
     63 <dt><b>-y&nbsp;</b><i>type</i></dt>
     64 <dd>Specify a <i>type</i>, which shall be compared with the SCCS %<b>Y</b>% keyword in <i>file</i>; see <a href=
     65 "../utilities/get.html#"><i>get</i></a> .</dd>
     66 </dl>
     67 </blockquote>
     68 <h4 class="mansect"><a name="tag_20_145_05" id="tag_20_145_05"></a>OPERANDS</h4>
     69 <blockquote>
     70 <p>The following operands shall be supported:</p>
     71 <dl compact>
     72 <dd></dd>
     73 <dt><i>file</i></dt>
     74 <dd>A pathname of an existing SCCS file. If exactly one <i>file</i> operand appears, and it is <tt>'-'</tt>, the standard input
     75 shall be read: each line shall be independently processed as if it were a command line argument list. (However, the line is not
     76 subjected to any of the shell word expansions, such as parameter expansion or quote removal.)</dd>
     77 </dl>
     78 </blockquote>
     79 <h4 class="mansect"><a name="tag_20_145_06" id="tag_20_145_06"></a>STDIN</h4>
     80 <blockquote>
     81 <p>The standard input shall be a text file used only when the <i>file</i> operand is specified as <tt>'-'</tt>.</p>
     82 </blockquote>
     83 <h4 class="mansect"><a name="tag_20_145_07" id="tag_20_145_07"></a>INPUT FILES</h4>
     84 <blockquote>
     85 <p>Any SCCS files processed shall be files of an unspecified format.</p>
     86 </blockquote>
     87 <h4 class="mansect"><a name="tag_20_145_08" id="tag_20_145_08"></a>ENVIRONMENT VARIABLES</h4>
     88 <blockquote>
     89 <p>The following environment variables shall affect the execution of <i>val</i>:</p>
     90 <dl compact>
     91 <dd></dd>
     92 <dt><i>LANG</i></dt>
     93 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
     94 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
     95 variables used to determine the values of locale categories.)</dd>
     96 <dt><i>LC_ALL</i></dt>
     97 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
     98 <dt><i>LC_CTYPE</i></dt>
     99 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    100 opposed to multi-byte characters in arguments and input files).</dd>
    101 <dt><i>LC_MESSAGES</i></dt>
    102 <dd><br>
    103 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error, and
    104 informative messages written to standard output.</dd>
    105 <dt><i>NLSPATH</i></dt>
    106 <dd>Determine the location of messages objects and message catalogs.</dd>
    107 </dl>
    108 </blockquote>
    109 <h4 class="mansect"><a name="tag_20_145_09" id="tag_20_145_09"></a>ASYNCHRONOUS EVENTS</h4>
    110 <blockquote>
    111 <p>Default.</p>
    112 </blockquote>
    113 <h4 class="mansect"><a name="tag_20_145_10" id="tag_20_145_10"></a>STDOUT</h4>
    114 <blockquote>
    115 <p>The standard output shall consist of informative messages about either:</p>
    116 <ol>
    117 <li>
    118 <p>Each file processed</p>
    119 </li>
    120 <li>
    121 <p>Each command line read from standard input</p>
    122 </li>
    123 </ol>
    124 <p>If the standard input is not used, for each <i>file</i> operand yielding a discrepancy, the output line shall have the following
    125 format:</p>
    126 <pre>
    127 <tt>"%s: %s\n", &lt;</tt><i>pathname</i><tt>&gt;, &lt;</tt><i>unspecified string</i><tt>&gt;
    128 </tt></pre>
    129 <p>If the standard input is used, for each input line yielding a discrepancy, the output shall have the following format:</p>
    130 <pre>
    131 <tt>"%s\n\n %s: %s\n", &lt;</tt><i>input</i><tt>&gt;, &lt;</tt><i>pathname</i><tt>&gt;, &lt;</tt><i>unspecified string</i><tt>&gt;
    132 </tt></pre>
    133 <p>where &lt;<i>input</i>&gt; is the input line minus its terminating &lt;newline&gt;.</p>
    134 </blockquote>
    135 <h4 class="mansect"><a name="tag_20_145_11" id="tag_20_145_11"></a>STDERR</h4>
    136 <blockquote>
    137 <p>Not used.</p>
    138 </blockquote>
    139 <h4 class="mansect"><a name="tag_20_145_12" id="tag_20_145_12"></a>OUTPUT FILES</h4>
    140 <blockquote>
    141 <p>None.</p>
    142 </blockquote>
    143 <h4 class="mansect"><a name="tag_20_145_13" id="tag_20_145_13"></a>EXTENDED DESCRIPTION</h4>
    144 <blockquote>
    145 <p>None.</p>
    146 </blockquote>
    147 <h4 class="mansect"><a name="tag_20_145_14" id="tag_20_145_14"></a>EXIT STATUS</h4>
    148 <blockquote>
    149 <p>The 8-bit code returned by <i>val</i> shall be a disjunction of the possible errors; that is, it can be interpreted as a bit
    150 string where set bits are interpreted as follows:</p>
    151 <table cellpadding="3">
    152 <tr valign="top">
    153 <td align="left">
    154 <p class="tent">0x80</p>
    155 </td>
    156 <td align="center">
    157 <p class="tent">=</p>
    158 </td>
    159 <td align="left">
    160 <p class="tent">Missing file argument.</p>
    161 </td>
    162 </tr>
    163 <tr valign="top">
    164 <td align="left">
    165 <p class="tent">0x40</p>
    166 </td>
    167 <td align="center">
    168 <p class="tent">=</p>
    169 </td>
    170 <td align="left">
    171 <p class="tent">Unknown or duplicate option.</p>
    172 </td>
    173 </tr>
    174 <tr valign="top">
    175 <td align="left">
    176 <p class="tent">0x20</p>
    177 </td>
    178 <td align="center">
    179 <p class="tent">=</p>
    180 </td>
    181 <td align="left">
    182 <p class="tent">Corrupted SCCS file.</p>
    183 </td>
    184 </tr>
    185 <tr valign="top">
    186 <td align="left">
    187 <p class="tent">0x10</p>
    188 </td>
    189 <td align="center">
    190 <p class="tent">=</p>
    191 </td>
    192 <td align="left">
    193 <p class="tent">Cannot open file or file not SCCS.</p>
    194 </td>
    195 </tr>
    196 <tr valign="top">
    197 <td align="left">
    198 <p class="tent">0x08</p>
    199 </td>
    200 <td align="center">
    201 <p class="tent">=</p>
    202 </td>
    203 <td align="left">
    204 <p class="tent"><i>SID</i> is invalid or ambiguous.</p>
    205 </td>
    206 </tr>
    207 <tr valign="top">
    208 <td align="left">
    209 <p class="tent">0x04</p>
    210 </td>
    211 <td align="center">
    212 <p class="tent">=</p>
    213 </td>
    214 <td align="left">
    215 <p class="tent"><i>SID</i> does not exist.</p>
    216 </td>
    217 </tr>
    218 <tr valign="top">
    219 <td align="left">
    220 <p class="tent">0x02</p>
    221 </td>
    222 <td align="center">
    223 <p class="tent">=</p>
    224 </td>
    225 <td align="left">
    226 <p class="tent">%<b>Y</b>%, <b>-y</b> mismatch.</p>
    227 </td>
    228 </tr>
    229 <tr valign="top">
    230 <td align="left">
    231 <p class="tent">0x01</p>
    232 </td>
    233 <td align="center">
    234 <p class="tent">=</p>
    235 </td>
    236 <td align="left">
    237 <p class="tent">%<b>M</b>%, <b>-m</b> mismatch.</p>
    238 </td>
    239 </tr>
    240 </table>
    241 <p class="tent">Note that <i>val</i> can process two or more files on a given command line and can process multiple command lines
    242 (when reading the standard input). In these cases an aggregate code shall be returned: a logical OR of the codes generated for each
    243 command line and file processed.</p>
    244 </blockquote>
    245 <h4 class="mansect"><a name="tag_20_145_15" id="tag_20_145_15"></a>CONSEQUENCES OF ERRORS</h4>
    246 <blockquote>
    247 <p>Default.</p>
    248 </blockquote>
    249 <hr>
    250 <div class="box"><em>The following sections are informative.</em></div>
    251 <h4 class="mansect"><a name="tag_20_145_16" id="tag_20_145_16"></a>APPLICATION USAGE</h4>
    252 <blockquote>
    253 <p>Since the <i>val</i> exit status sets the 0x80 bit, shell applications checking <tt>"$?"</tt> cannot tell if it terminated due
    254 to a missing file argument or receipt of a signal.</p>
    255 </blockquote>
    256 <h4 class="mansect"><a name="tag_20_145_17" id="tag_20_145_17"></a>EXAMPLES</h4>
    257 <blockquote>
    258 <p>In a directory with three SCCS files—<b>s.x</b> (of <b>t</b> type &quot;text&quot;), <b>s.y</b>, and <b>s.z</b> (a corrupted file)—the
    259 following command could produce the output shown:</p>
    260 <pre>
    261 <tt>val - &lt;&lt;EOF
    262 -y source s.x
    263 -m y s.y
    264 s.z
    265 EOF
    266 -y source s.x
    267 <br class="tent">
    268     s.x: %Y%, -y mismatch
    269 s.z
    270 <br class="tent">
    271     s.z: corrupted SCCS file
    272 </tt></pre></blockquote>
    273 <h4 class="mansect"><a name="tag_20_145_18" id="tag_20_145_18"></a>RATIONALE</h4>
    274 <blockquote>
    275 <p>None.</p>
    276 </blockquote>
    277 <h4 class="mansect"><a name="tag_20_145_19" id="tag_20_145_19"></a>FUTURE DIRECTIONS</h4>
    278 <blockquote>
    279 <p>If this utility is directed to display a pathname that contains any bytes that have the encoded value of a &lt;newline&gt;
    280 character when &lt;newline&gt; is a terminator or separator in the output format being used, implementations are encouraged to
    281 treat this as an error. A future version of this standard may require implementations to treat this as an error.</p>
    282 </blockquote>
    283 <h4 class="mansect"><a name="tag_20_145_20" id="tag_20_145_20"></a>SEE ALSO</h4>
    284 <blockquote>
    285 <p><a href="../utilities/admin.html#"><i>admin</i></a> , <a href="../utilities/delta.html#"><i>delta</i></a> , <a href=
    286 "../utilities/get.html#"><i>get</i></a> , <a href="../utilities/prs.html#"><i>prs</i></a></p>
    287 <p class="tent">XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    288 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    289 </blockquote>
    290 <h4 class="mansect"><a name="tag_20_145_21" id="tag_20_145_21"></a>CHANGE HISTORY</h4>
    291 <blockquote>
    292 <p>First released in Issue 2.</p>
    293 </blockquote>
    294 <h4 class="mansect"><a name="tag_20_145_22" id="tag_20_145_22"></a>Issue 6</h4>
    295 <blockquote>
    296 <p>The Open Group Corrigendum U025/4 is applied, correcting a typographical error in the EXIT STATUS.</p>
    297 </blockquote>
    298 <h4 class="mansect"><a name="tag_20_145_23" id="tag_20_145_23"></a>Issue 7</h4>
    299 <blockquote>
    300 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p>
    301 <p class="tent">POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0147 [416] and XCU/TC1-2008/0148 [416] are applied.</p>
    302 </blockquote>
    303 <h4 class="mansect"><a name="tag_20_145_24" id="tag_20_145_24"></a>Issue 8</h4>
    304 <blockquote>
    305 <p>Austin Group Defect 251 is applied, encouraging implementations to report an error if a utility is directed to display a
    306 pathname that contains any bytes that have the encoded value of a &lt;newline&gt; character when &lt;newline&gt; is a terminator or
    307 separator in the output format being used.</p>
    308 <p class="tent">Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    309 </blockquote>
    310 <div class="box"><em>End of informative text.</em></div>
    311 <hr>
    312 <p>&nbsp;</p>
    313 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    314 <hr size="2" noshade>
    315 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    316 POSIX™ is a Trademark of The IEEE.<br>
    317 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    318 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    319 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    320 ]</font></center>
    321 <hr size="2" noshade>
    322 <div class="NAVHEADER">
    323 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    324 <tr class="nav">
    325 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/uux.html" accesskey="P">&lt;&lt;&lt;
    326 Previous</a></td>
    327 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    328 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/vi.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    329 </tr>
    330 </table>
    331 <hr align="left" width="100%"></div>
    332 </body>
    333 </html>