Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
what.html (11468B)
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>what</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/wc.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/who.html" accesskey="N">Next >>></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="what" id="what"></a> <a name="tag_20_149" id="tag_20_149"></a><!-- what --> 28 <h4 class="mansect"><a name="tag_20_149_01" id="tag_20_149_01"></a>NAME</h4> 29 <blockquote>what — identify SCCS files (<b>DEVELOPMENT</b>)</blockquote> 30 <h4 class="mansect"><a name="tag_20_149_02" id="tag_20_149_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"> what</tt> <b>[</b><tt>-s</tt><b>]</b> <i>file</i><tt>... <img src="../images/opt-end.gif" alt= 34 "[Option End]" border="0"></tt></code></div> 35 </blockquote> 36 <h4 class="mansect"><a name="tag_20_149_03" id="tag_20_149_03"></a>DESCRIPTION</h4> 37 <blockquote> 38 <p>The <i>what</i> utility shall search the given files for all occurrences of the pattern that <a href= 39 "../utilities/get.html"><i>get</i></a> (see <a href="../utilities/get.html#"><i>get</i></a> ) substitutes for the %<b>Z</b>% 40 keyword (<tt>"@(#)"</tt>). The <i>what</i> utility shall write to standard output the identification string that follows up to, but 41 not including, the first occurrence of one of the following: <double-quote> (<tt>'"'</tt> ), <greater-than-sign> 42 (<tt>'>'</tt>), <newline>, <backslash> (<tt>'\\'</tt>), <NUL> (<tt>'\0'</tt>), or an end-of-file condition on 43 the input file. If not at end-of-file, the <i>what</i> utility shall then look for the next occurrence of <tt>"@(#)"</tt> after one 44 of those characters.</p> 45 </blockquote> 46 <h4 class="mansect"><a name="tag_20_149_04" id="tag_20_149_04"></a>OPTIONS</h4> 47 <blockquote> 48 <p>The <i>what</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 49 Guidelines</i></a> .</p> 50 <p>The following option shall be supported:</p> 51 <dl compact> 52 <dd></dd> 53 <dt><b>-s</b></dt> 54 <dd>Write at most one identification string for each file. After locating and writing to standard output the identification string 55 following the first pattern (if any) in a file, no further data shall be read from that file and the search shall recommence from 56 the beginning of the next file, if any.</dd> 57 </dl> 58 </blockquote> 59 <h4 class="mansect"><a name="tag_20_149_05" id="tag_20_149_05"></a>OPERANDS</h4> 60 <blockquote> 61 <p>The following operands shall be supported:</p> 62 <dl compact> 63 <dd></dd> 64 <dt><i>file</i></dt> 65 <dd>A pathname of a file to search.</dd> 66 </dl> 67 </blockquote> 68 <h4 class="mansect"><a name="tag_20_149_06" id="tag_20_149_06"></a>STDIN</h4> 69 <blockquote> 70 <p>Not used.</p> 71 </blockquote> 72 <h4 class="mansect"><a name="tag_20_149_07" id="tag_20_149_07"></a>INPUT FILES</h4> 73 <blockquote> 74 <p>The input files shall be of any file type.</p> 75 </blockquote> 76 <h4 class="mansect"><a name="tag_20_149_08" id="tag_20_149_08"></a>ENVIRONMENT VARIABLES</h4> 77 <blockquote> 78 <p>The following environment variables shall affect the execution of <i>what</i>:</p> 79 <dl compact> 80 <dd></dd> 81 <dt><i>LANG</i></dt> 82 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 83 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 84 variables used to determine the values of locale categories.)</dd> 85 <dt><i>LC_ALL</i></dt> 86 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 87 <dt><i>LC_CTYPE</i></dt> 88 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 89 opposed to multi-byte characters in arguments and input files).</dd> 90 <dt><i>LC_MESSAGES</i></dt> 91 <dd><br> 92 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 93 <dt><i>NLSPATH</i></dt> 94 <dd>Determine the location of messages objects and message catalogs.</dd> 95 </dl> 96 </blockquote> 97 <h4 class="mansect"><a name="tag_20_149_09" id="tag_20_149_09"></a>ASYNCHRONOUS EVENTS</h4> 98 <blockquote> 99 <p>Default.</p> 100 </blockquote> 101 <h4 class="mansect"><a name="tag_20_149_10" id="tag_20_149_10"></a>STDOUT</h4> 102 <blockquote> 103 <p>For each <i>file</i> operand, the standard output shall consist of:</p> 104 <pre> 105 <tt>"%s:\n", <</tt><i>pathname</i><tt>> 106 </tt></pre> 107 <p>followed by zero or more of:</p> 108 <pre> 109 <tt>"\t%s\n", <</tt><i>identification string</i><tt>> 110 </tt></pre> 111 <p>one for each identification string located.</p> 112 </blockquote> 113 <h4 class="mansect"><a name="tag_20_149_11" id="tag_20_149_11"></a>STDERR</h4> 114 <blockquote> 115 <p>The standard error shall be used only for diagnostic messages.</p> 116 </blockquote> 117 <h4 class="mansect"><a name="tag_20_149_12" id="tag_20_149_12"></a>OUTPUT FILES</h4> 118 <blockquote> 119 <p>None.</p> 120 </blockquote> 121 <h4 class="mansect"><a name="tag_20_149_13" id="tag_20_149_13"></a>EXTENDED DESCRIPTION</h4> 122 <blockquote> 123 <p>None.</p> 124 </blockquote> 125 <h4 class="mansect"><a name="tag_20_149_14" id="tag_20_149_14"></a>EXIT STATUS</h4> 126 <blockquote> 127 <p>The following exit values shall be returned:</p> 128 <dl compact> 129 <dd></dd> 130 <dt>0</dt> 131 <dd>One or more matches were found and the output specified in STDOUT was successfully written to standard output.</dd> 132 <dt>1</dt> 133 <dd>No matches were found or an error occurred.</dd> 134 </dl> 135 </blockquote> 136 <h4 class="mansect"><a name="tag_20_149_15" id="tag_20_149_15"></a>CONSEQUENCES OF ERRORS</h4> 137 <blockquote> 138 <p>Default.</p> 139 </blockquote> 140 <hr> 141 <div class="box"><em>The following sections are informative.</em></div> 142 <h4 class="mansect"><a name="tag_20_149_16" id="tag_20_149_16"></a>APPLICATION USAGE</h4> 143 <blockquote> 144 <p>The <i>what</i> utility is intended to be used in conjunction with the SCCS command <a href= 145 "../utilities/get.html"><i>get</i></a>, which automatically inserts identifying information, but it can also be used where the 146 information is inserted by any other means.</p> 147 <p>When the string <tt>"@(#)"</tt> is included in a library routine in a shared library, it might not be found in an <b>a.out</b> 148 file using that library routine.</p> 149 </blockquote> 150 <h4 class="mansect"><a name="tag_20_149_17" id="tag_20_149_17"></a>EXAMPLES</h4> 151 <blockquote> 152 <p>If the C-language program in file <b>f.c</b> contains:</p> 153 <pre> 154 <tt>char ident[] = "@(#)identification information"; 155 </tt></pre> 156 <p>and <b>f.c</b> is compiled to yield <b>f.o</b> and <b>a.out</b>, then the command:</p> 157 <pre> 158 <tt>what f.c f.o a.out 159 </tt></pre> 160 <p>writes:</p> 161 <pre> 162 <tt>f.c: 163 identification information 164 ... 165 f.o: 166 identification information 167 ... 168 a.out: 169 identification information 170 ... 171 </tt></pre></blockquote> 172 <h4 class="mansect"><a name="tag_20_149_18" id="tag_20_149_18"></a>RATIONALE</h4> 173 <blockquote> 174 <p>This standard requires that when the <b>-s</b> option is used, <i>what</i> does not continue reading from the current file after 175 writing the first identification string. This might seem an unimportant detail, but applications would experience different 176 behavior if a <i>file</i> operand named a FIFO special file and <i>what</i> waited for an end-of-file condition rather than closing 177 the file straight away.</p> 178 </blockquote> 179 <h4 class="mansect"><a name="tag_20_149_19" id="tag_20_149_19"></a>FUTURE DIRECTIONS</h4> 180 <blockquote> 181 <p>If this utility is directed to display a pathname that contains any bytes that have the encoded value of a <newline> 182 character when <newline> is a terminator or separator in the output format being used, implementations are encouraged to 183 treat this as an error. A future version of this standard may require implementations to treat this as an error.</p> 184 </blockquote> 185 <h4 class="mansect"><a name="tag_20_149_20" id="tag_20_149_20"></a>SEE ALSO</h4> 186 <blockquote> 187 <p><a href="../utilities/get.html#"><i>get</i></a></p> 188 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 189 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p> 190 </blockquote> 191 <h4 class="mansect"><a name="tag_20_149_21" id="tag_20_149_21"></a>CHANGE HISTORY</h4> 192 <blockquote> 193 <p>First released in Issue 2.</p> 194 </blockquote> 195 <h4 class="mansect"><a name="tag_20_149_22" id="tag_20_149_22"></a>Issue 8</h4> 196 <blockquote> 197 <p>Austin Group Defect 251 is applied, encouraging implementations to report an error if a utility is directed to display a 198 pathname that contains any bytes that have the encoded value of a <newline> character when <newline> is a terminator or 199 separator in the output format being used.</p> 200 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 201 <p>Austin Group Defect 1512 is applied, changing the EXIT STATUS section.</p> 202 <p>Austin Group Defect 1538 is applied, clarifying the <b>-s</b> option.</p> 203 <p>Austin Group Defect 1563 is applied, clarifying the output format when the <i>what</i> utility finds multiple identification 204 strings in one file.</p> 205 </blockquote> 206 <div class="box"><em>End of informative text.</em></div> 207 <hr> 208 <p> </p> 209 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 210 <hr size="2" noshade> 211 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 212 POSIX™ is a Trademark of The IEEE.<br> 213 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 214 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 215 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 216 ]</font></center> 217 <hr size="2" noshade> 218 <div class="NAVHEADER"> 219 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 220 <tr class="nav"> 221 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/wc.html" accesskey="P"><<< 222 Previous</a></td> 223 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 224 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/who.html" accesskey="N">Next >>></a></td> 225 </tr> 226 </table> 227 <hr align="left" width="100%"></div> 228 </body> 229 </html>