isposix

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

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

hash.html (11978B)


      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>hash</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/grep.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/head.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="hash" id="hash"></a> <a name="tag_20_56" id="tag_20_56"></a><!-- hash -->
     28 <h4 class="mansect"><a name="tag_20_56_01" id="tag_20_56_01"></a>NAME</h4>
     29 <blockquote>hash — remember or report utility locations</blockquote>
     30 <h4 class="mansect"><a name="tag_20_56_02" id="tag_20_56_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <p><code><tt>hash</tt> <b>[</b><i>utility</i><tt>...</tt><b>]</b> <tt><br>
     33 <br>
     34 hash -r<br></tt></code></p>
     35 </blockquote>
     36 <h4 class="mansect"><a name="tag_20_56_03" id="tag_20_56_03"></a>DESCRIPTION</h4>
     37 <blockquote>
     38 <p>The <i>hash</i> utility shall affect the way the current shell environment remembers the locations of utilities found as
     39 described in <a href="../utilities/V3_chap02.html#tag_19_09_01_04"><i>2.9.1.4 Command Search and Execution</i></a> . Depending on
     40 the arguments specified, it shall add utility locations to its list of remembered locations or it shall purge the contents of the
     41 list. When no arguments are specified, it shall report on the contents of the list.</p>
     42 <p>Utilities provided as built-ins to the shell and functions shall not be reported by <i>hash</i>.</p>
     43 </blockquote>
     44 <h4 class="mansect"><a name="tag_20_56_04" id="tag_20_56_04"></a>OPTIONS</h4>
     45 <blockquote>
     46 <p>The <i>hash</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     47 Guidelines</i></a> .</p>
     48 <p>The following option shall be supported:</p>
     49 <dl compact>
     50 <dd></dd>
     51 <dt><b>-r</b></dt>
     52 <dd>Forget all previously remembered utility locations.</dd>
     53 </dl>
     54 </blockquote>
     55 <h4 class="mansect"><a name="tag_20_56_05" id="tag_20_56_05"></a>OPERANDS</h4>
     56 <blockquote>
     57 <p>The following operand shall be supported:</p>
     58 <dl compact>
     59 <dd></dd>
     60 <dt><i>utility</i></dt>
     61 <dd>The name of a utility to be searched for and added to the list of remembered locations. If the search does not find
     62 <i>utility</i>, it is unspecified whether or not this is treated as an error. If <i>utility</i> contains one or more &lt;slash&gt;
     63 characters, the results are unspecified.</dd>
     64 </dl>
     65 </blockquote>
     66 <h4 class="mansect"><a name="tag_20_56_06" id="tag_20_56_06"></a>STDIN</h4>
     67 <blockquote>
     68 <p>Not used.</p>
     69 </blockquote>
     70 <h4 class="mansect"><a name="tag_20_56_07" id="tag_20_56_07"></a>INPUT FILES</h4>
     71 <blockquote>
     72 <p>None.</p>
     73 </blockquote>
     74 <h4 class="mansect"><a name="tag_20_56_08" id="tag_20_56_08"></a>ENVIRONMENT VARIABLES</h4>
     75 <blockquote>
     76 <p>The following environment variables shall affect the execution of <i>hash</i>:</p>
     77 <dl compact>
     78 <dd></dd>
     79 <dt><i>LANG</i></dt>
     80 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
     81 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
     82 variables used to determine the values of locale categories.)</dd>
     83 <dt><i>LC_ALL</i></dt>
     84 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
     85 <dt><i>LC_CTYPE</i></dt>
     86 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
     87 opposed to multi-byte characters in arguments).</dd>
     88 <dt><i>LC_MESSAGES</i></dt>
     89 <dd><br>
     90 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
     91 <dt><i>NLSPATH</i></dt>
     92 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     93 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
     94 "0"></dd>
     95 <dt><i>PATH</i></dt>
     96 <dd>Determine the location of <i>utility</i>, as described in XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment
     97 Variables</i></a> .</dd>
     98 </dl>
     99 </blockquote>
    100 <h4 class="mansect"><a name="tag_20_56_09" id="tag_20_56_09"></a>ASYNCHRONOUS EVENTS</h4>
    101 <blockquote>
    102 <p>Default.</p>
    103 </blockquote>
    104 <h4 class="mansect"><a name="tag_20_56_10" id="tag_20_56_10"></a>STDOUT</h4>
    105 <blockquote>
    106 <p>The standard output of <i>hash</i> shall be used when no arguments are specified. Its format is unspecified, but includes the
    107 pathname of each utility in the list of remembered locations for the current shell environment. This list shall consist of those
    108 utilities named in previous <i>hash</i> invocations that have been invoked, and may contain those invoked and found through the
    109 normal command search process. This list shall be cleared when the contents of the <i>PATH</i> environment variable are
    110 changed.</p>
    111 </blockquote>
    112 <h4 class="mansect"><a name="tag_20_56_11" id="tag_20_56_11"></a>STDERR</h4>
    113 <blockquote>
    114 <p>The standard error shall be used only for diagnostic messages.</p>
    115 </blockquote>
    116 <h4 class="mansect"><a name="tag_20_56_12" id="tag_20_56_12"></a>OUTPUT FILES</h4>
    117 <blockquote>
    118 <p>None.</p>
    119 </blockquote>
    120 <h4 class="mansect"><a name="tag_20_56_13" id="tag_20_56_13"></a>EXTENDED DESCRIPTION</h4>
    121 <blockquote>
    122 <p>None.</p>
    123 </blockquote>
    124 <h4 class="mansect"><a name="tag_20_56_14" id="tag_20_56_14"></a>EXIT STATUS</h4>
    125 <blockquote>
    126 <p>The following exit values shall be returned:</p>
    127 <dl compact>
    128 <dd></dd>
    129 <dt>&nbsp;0</dt>
    130 <dd>Successful completion.</dd>
    131 <dt>&gt;0</dt>
    132 <dd>An error occurred.</dd>
    133 </dl>
    134 </blockquote>
    135 <h4 class="mansect"><a name="tag_20_56_15" id="tag_20_56_15"></a>CONSEQUENCES OF ERRORS</h4>
    136 <blockquote>
    137 <p>Default.</p>
    138 </blockquote>
    139 <hr>
    140 <div class="box"><em>The following sections are informative.</em></div>
    141 <h4 class="mansect"><a name="tag_20_56_16" id="tag_20_56_16"></a>APPLICATION USAGE</h4>
    142 <blockquote>
    143 <p>This utility is required to be intrinsic. See <a href="../utilities/V3_chap01.html#tag_18_07"><i>1.7 Intrinsic Utilities</i></a>
    144 for details.</p>
    145 <p>Since <i>hash</i> affects the current shell execution environment, it is always provided as a shell regular built-in. If it is
    146 called in a separate utility execution environment, such as one of the following:</p>
    147 <pre>
    148 <tt>nohup hash -r
    149 find . -type f -exec hash {} +
    150 </tt></pre>
    151 <p>it does not affect the command search process of the caller's environment.</p>
    152 <p>The <i>hash</i> utility may be implemented as an alias—for example, <a href="../utilities/alias.html"><i>alias</i></a>
    153 <b>-t&nbsp;-</b>, in which case utilities found through normal command search are not listed by the <i>hash</i> command.</p>
    154 <p>The effects of <i>hash</i> <b>-r</b> can also be achieved portably by resetting the value of <i>PATH ;</i> in the simplest form,
    155 this can be:</p>
    156 <pre>
    157 <tt>PATH="$PATH"
    158 </tt></pre>
    159 <p>The use of <i>hash</i> with <i>utility</i> names is unnecessary for most applications, but may provide a performance improvement
    160 on a few implementations; normally, the hashing process is included by default.</p>
    161 </blockquote>
    162 <h4 class="mansect"><a name="tag_20_56_17" id="tag_20_56_17"></a>EXAMPLES</h4>
    163 <blockquote>
    164 <p>None.</p>
    165 </blockquote>
    166 <h4 class="mansect"><a name="tag_20_56_18" id="tag_20_56_18"></a>RATIONALE</h4>
    167 <blockquote>
    168 <p>None.</p>
    169 </blockquote>
    170 <h4 class="mansect"><a name="tag_20_56_19" id="tag_20_56_19"></a>FUTURE DIRECTIONS</h4>
    171 <blockquote>
    172 <p>If this utility is directed to display a pathname that contains any bytes that have the encoded value of a &lt;newline&gt;
    173 character when &lt;newline&gt; is a terminator or separator in the output format being used, implementations are encouraged to
    174 treat this as an error. A future version of this standard may require implementations to treat this as an error.</p>
    175 </blockquote>
    176 <h4 class="mansect"><a name="tag_20_56_20" id="tag_20_56_20"></a>SEE ALSO</h4>
    177 <blockquote>
    178 <p><a href="../utilities/V3_chap02.html#tag_19_09_01_04"><i>2.9.1.4 Command Search and Execution</i></a></p>
    179 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    180 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    181 </blockquote>
    182 <h4 class="mansect"><a name="tag_20_56_21" id="tag_20_56_21"></a>CHANGE HISTORY</h4>
    183 <blockquote>
    184 <p>First released in Issue 2.</p>
    185 </blockquote>
    186 <h4 class="mansect"><a name="tag_20_56_22" id="tag_20_56_22"></a>Issue 7</h4>
    187 <blockquote>
    188 <p>The <i>hash</i> utility is moved from the XSI option to the Base.</p>
    189 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0093 [241] is applied.</p>
    190 </blockquote>
    191 <h4 class="mansect"><a name="tag_20_56_23" id="tag_20_56_23"></a>Issue 8</h4>
    192 <blockquote>
    193 <p>Austin Group Defect 248 is applied, changing a command line in the APPLICATION USAGE section.</p>
    194 <p>Austin Group Defect 251 is applied, encouraging implementations to report an error if a utility is directed to display a
    195 pathname that contains any bytes that have the encoded value of a &lt;newline&gt; character when &lt;newline&gt; is a terminator or
    196 separator in the output format being used.</p>
    197 <p>Austin Group Defect 854 is applied, adding a note to the APPLICATION USAGE section that this utility is required to be
    198 intrinsic.</p>
    199 <p>Austin Group Defect 1063 is applied, clarifying that functions are not reported by <i>hash</i>, and that the list of remembered
    200 locations is cleared when the contents of <i>PATH</i> are changed.</p>
    201 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    202 <p>Austin Group Defect 1460 is applied, making it explicitly unspecified whether or not <i>hash</i> reports an error if it cannot
    203 find <i>utility</i>.</p>
    204 </blockquote>
    205 <div class="box"><em>End of informative text.</em></div>
    206 <hr>
    207 <p>&nbsp;</p>
    208 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    209 <hr size="2" noshade>
    210 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    211 POSIX™ is a Trademark of The IEEE.<br>
    212 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    213 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    214 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    215 ]</font></center>
    216 <hr size="2" noshade>
    217 <div class="NAVHEADER">
    218 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    219 <tr class="nav">
    220 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/grep.html" accesskey="P">&lt;&lt;&lt;
    221 Previous</a></td>
    222 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    223 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/head.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    224 </tr>
    225 </table>
    226 <hr align="left" width="100%"></div>
    227 </body>
    228 </html>