isposix

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

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

cd.html (24963B)


      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>cd</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/cat.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/cflow.html" accesskey="N">Next
     19 &gt;&gt;&gt;</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="cd" id="cd"></a> <a name="tag_20_14" id="tag_20_14"></a><!-- cd -->
     29 <h4 class="mansect"><a name="tag_20_14_01" id="tag_20_14_01"></a>NAME</h4>
     30 <blockquote>cd — change the working directory</blockquote>
     31 <h4 class="mansect"><a name="tag_20_14_02" id="tag_20_14_02"></a>SYNOPSIS</h4>
     32 <blockquote class="synopsis">
     33 <p><code><tt>cd</tt> <b>[</b><tt>-L</tt><b>] [</b><i>directory</i><b>]</b> <tt><br>
     34 <br>
     35 cd -P</tt> <b>[</b><tt>-e</tt><b>] [</b><i>directory</i><b>]</b> <tt><br></tt></code></p>
     36 </blockquote>
     37 <h4 class="mansect"><a name="tag_20_14_03" id="tag_20_14_03"></a>DESCRIPTION</h4>
     38 <blockquote>
     39 <p>The <i>cd</i> utility shall change the working directory of the current shell execution environment (see <a href=
     40 "../utilities/V3_chap02.html#tag_19_13"><i>2.13 Shell Execution Environment</i></a> ) by executing the following steps in sequence.
     41 (In the following steps, the symbol <b>curpath</b> represents an intermediate value used to simplify the description of the
     42 algorithm used by <i>cd</i>. There is no requirement that <b>curpath</b> be made visible to the application.)</p>
     43 <ol>
     44 <li>
     45 <p>If no <i>directory</i> operand is given and the <i>HOME</i> environment variable is empty or undefined, the default behavior is
     46 implementation-defined and no further steps shall be taken.</p>
     47 </li>
     48 <li>
     49 <p>If no <i>directory</i> operand is given and the <i>HOME</i> environment variable is set to a non-empty value, the <i>cd</i>
     50 utility shall behave as if the directory named in the <i>HOME</i> environment variable was specified as the <i>directory</i>
     51 operand.</p>
     52 </li>
     53 <li>
     54 <p>If the <i>directory</i> operand begins with a &lt;slash&gt; character, set <b>curpath</b> to the operand and proceed to step
     55 7.</p>
     56 </li>
     57 <li>
     58 <p>If the first component of the <i>directory</i> operand is dot or dot-dot, proceed to step 6.</p>
     59 </li>
     60 <li>
     61 <p>Starting with the first pathname in the &lt;colon&gt;-separated pathnames of <i>CDPATH</i> (see the ENVIRONMENT VARIABLES
     62 section) if the pathname is non-null, test if the concatenation of that pathname, a &lt;slash&gt; character if that pathname did
     63 not end with a &lt;slash&gt; character, and the <i>directory</i> operand names a directory. If the pathname is null, test if the
     64 concatenation of dot, a &lt;slash&gt; character, and the operand names a directory. In either case, if the resulting string names
     65 an existing directory, set <b>curpath</b> to that string and proceed to step 7. Otherwise, repeat this step with the next pathname
     66 in <i>CDPATH</i> until all pathnames have been tested.</p>
     67 </li>
     68 <li>
     69 <p>Set <b>curpath</b> to the <i>directory</i> operand.</p>
     70 </li>
     71 <li>
     72 <p>If the <b>-P</b> option is in effect, proceed to step 10. If <b>curpath</b> does not begin with a &lt;slash&gt; character, set
     73 <b>curpath</b> to the string formed by the concatenation of the value of <i>PWD ,</i> a &lt;slash&gt; character if the value of
     74 <i>PWD</i> did not end with a &lt;slash&gt; character, and <b>curpath</b>.</p>
     75 </li>
     76 <li>
     77 <p>The <b>curpath</b> value shall then be converted to canonical form as follows, considering each component from beginning to end,
     78 in sequence:</p>
     79 <ol type="a">
     80 <li>
     81 <p>Dot components and any &lt;slash&gt; characters that separate them from the next component shall be deleted.</p>
     82 </li>
     83 <li>
     84 <p>For each dot-dot component, if there is a preceding component and it is neither root nor dot-dot, then:</p>
     85 <ol type="i">
     86 <li>
     87 <p>If the preceding component does not refer (in the context of pathname resolution with symbolic links followed) to a directory,
     88 then the <i>cd</i> utility shall display an appropriate error message and no further steps shall be taken.</p>
     89 </li>
     90 <li>
     91 <p>The preceding component, all &lt;slash&gt; characters separating the preceding component from dot-dot, dot-dot, and all
     92 &lt;slash&gt; characters separating dot-dot from the following component (if any) shall be deleted.</p>
     93 </li>
     94 </ol>
     95 </li>
     96 <li>
     97 <p>An implementation may further simplify <b>curpath</b> by removing any trailing &lt;slash&gt; characters that are not also
     98 leading &lt;slash&gt; characters, replacing multiple non-leading consecutive &lt;slash&gt; characters with a single &lt;slash&gt;,
     99 and replacing three or more leading &lt;slash&gt; characters with a single &lt;slash&gt;. If, as a result of this canonicalization,
    100 the <b>curpath</b> variable is null, no further steps shall be taken.</p>
    101 </li>
    102 </ol>
    103 </li>
    104 <li>
    105 <p>If <b>curpath</b> is longer than {PATH_MAX} bytes (including the terminating null) and the <i>directory</i> operand was not
    106 longer than {PATH_MAX} bytes (including the terminating null), then <b>curpath</b> shall be converted from an absolute pathname to
    107 an equivalent relative pathname if possible. This conversion shall always be considered possible if the value of <i>PWD ,</i> with
    108 a trailing &lt;slash&gt; added if it does not already have one, is an initial substring of <b>curpath</b>. Whether or not it is
    109 considered possible under other circumstances is unspecified. Implementations may also apply this conversion if <b>curpath</b> is
    110 not longer than {PATH_MAX} bytes or the <i>directory</i> operand was longer than {PATH_MAX} bytes.</p>
    111 </li>
    112 <li>
    113 <p>The <i>cd</i> utility shall then perform actions equivalent to the <a href="../functions/chdir.html"><i>chdir</i>()</a> function
    114 called with <b>curpath</b> as the <i>path</i> argument. If these actions fail for any reason, the <i>cd</i> utility shall display
    115 an appropriate error message and the remainder of this step shall not be executed. If the <b>-P</b> option is not in effect, the
    116 <i>PWD</i> environment variable shall be set to the value that <b>curpath</b> had on entry to step 9 (i.e., before conversion to a
    117 relative pathname).</p>
    118 <p>If the <b>-P</b> option is in effect, the <i>PWD</i> environment variable shall be set to the string that would be output by
    119 <a href="../utilities/pwd.html"><i>pwd</i></a> <b>-P</b>. If there is insufficient permission on the new directory, or on any
    120 parent of that directory, to determine the current working directory, the value of the <i>PWD</i> environment variable is
    121 unspecified. If both the <b>-e</b> and the <b>-P</b> options are in effect and <i>cd</i> is unable to determine the pathname of the
    122 current working directory, <i>cd</i> shall complete successfully but return a non-zero exit status.</p>
    123 </li>
    124 </ol>
    125 <p>If, during the execution of the above steps, the <i>PWD</i> environment variable is set, the <i>OLDPWD</i> shell variable shall
    126 also be set to the value of the old working directory (that is the current working directory immediately prior to the call to
    127 <i>cd</i>). It is unspecified whether, when setting <i>OLDPWD ,</i> the shell also causes it to be exported if it was not
    128 already.</p>
    129 </blockquote>
    130 <h4 class="mansect"><a name="tag_20_14_04" id="tag_20_14_04"></a>OPTIONS</h4>
    131 <blockquote>
    132 <p>The <i>cd</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
    133 Guidelines</i></a> .</p>
    134 <p>The following options shall be supported by the implementation:</p>
    135 <dl compact>
    136 <dd></dd>
    137 <dt><b>-e</b></dt>
    138 <dd>If the <b>-P</b> option is in effect, the current working directory is successfully changed, and the correct value of the
    139 <i>PWD</i> environment variable cannot be determined, exit with exit status 1.</dd>
    140 <dt><b>-L</b></dt>
    141 <dd>Handle the operand dot-dot logically; symbolic link components shall not be resolved before dot-dot components are processed
    142 (see steps 8. and 9. in the DESCRIPTION).</dd>
    143 <dt><b>-P</b></dt>
    144 <dd>Handle the operand dot-dot physically; symbolic link components shall be resolved before dot-dot components are processed (see
    145 step 7. in the DESCRIPTION).</dd>
    146 </dl>
    147 <p>If both <b>-L</b> and <b>-P</b> options are specified, the last of these options shall be used and all others ignored. If
    148 neither <b>-L</b> nor <b>-P</b> is specified, the operand shall be handled dot-dot logically; see the DESCRIPTION.</p>
    149 </blockquote>
    150 <h4 class="mansect"><a name="tag_20_14_05" id="tag_20_14_05"></a>OPERANDS</h4>
    151 <blockquote>
    152 <p>The following operands shall be supported:</p>
    153 <dl compact>
    154 <dd></dd>
    155 <dt><i>directory</i></dt>
    156 <dd>An absolute or relative pathname of the directory that shall become the new working directory. The interpretation of a relative
    157 pathname by <i>cd</i> depends on the <b>-L</b> option and the <i>CDPATH</i> and <i>PWD</i> environment variables. If
    158 <i>directory</i> is an empty string, <i>cd</i> shall write a diagnostic message to standard error and exit with non-zero status. If
    159 <i>directory</i> consists of a single <tt>'-'</tt> (&lt;hyphen-minus&gt;) character, the <i>cd</i> utility shall behave as if
    160 <i>directory</i> contained the value of the <i>OLDPWD</i> environment variable, except that after it sets the value of <i>PWD</i>
    161 it shall write the new value to standard output. The behavior is unspecified if <i>OLDPWD</i> does not start with a &lt;slash&gt;
    162 character.</dd>
    163 </dl>
    164 </blockquote>
    165 <h4 class="mansect"><a name="tag_20_14_06" id="tag_20_14_06"></a>STDIN</h4>
    166 <blockquote>
    167 <p>Not used.</p>
    168 </blockquote>
    169 <h4 class="mansect"><a name="tag_20_14_07" id="tag_20_14_07"></a>INPUT FILES</h4>
    170 <blockquote>
    171 <p>None.</p>
    172 </blockquote>
    173 <h4 class="mansect"><a name="tag_20_14_08" id="tag_20_14_08"></a>ENVIRONMENT VARIABLES</h4>
    174 <blockquote>
    175 <p>The following environment variables shall affect the execution of <i>cd</i>:</p>
    176 <dl compact>
    177 <dd></dd>
    178 <dt><i>CDPATH</i></dt>
    179 <dd>A &lt;colon&gt;-separated list of pathnames that refer to directories. The <i>cd</i> utility shall use this list in its attempt
    180 to change the directory, as described in the DESCRIPTION. An empty string in place of a directory pathname represents the current
    181 directory. If <i>CDPATH</i> is not set, it shall be treated as if it were an empty string.</dd>
    182 <dt><i>HOME</i></dt>
    183 <dd>The name of the directory, used when no <i>directory</i> operand is specified.</dd>
    184 <dt><i>LANG</i></dt>
    185 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
    186 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
    187 variables used to determine the values of locale categories.)</dd>
    188 <dt><i>LC_ALL</i></dt>
    189 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
    190 <dt><i>LC_CTYPE</i></dt>
    191 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    192 opposed to multi-byte characters in arguments).</dd>
    193 <dt><i>LC_MESSAGES</i></dt>
    194 <dd><br>
    195 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
    196 <dt><i>NLSPATH</i></dt>
    197 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    198 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
    199 "0"></dd>
    200 <dt><i>OLDPWD</i></dt>
    201 <dd>A pathname of the previous working directory, used when the operand is <tt>'-'</tt>. If an application sets or unsets the value
    202 of <i>OLDPWD ,</i> the behavior of <i>cd</i> with a <tt>'-'</tt> operand is unspecified.</dd>
    203 <dt><i>PWD</i></dt>
    204 <dd>This variable shall be set as specified in the DESCRIPTION. If an application sets or unsets the value of <i>PWD ,</i> the
    205 behavior of <i>cd</i> is unspecified.</dd>
    206 </dl>
    207 </blockquote>
    208 <h4 class="mansect"><a name="tag_20_14_09" id="tag_20_14_09"></a>ASYNCHRONOUS EVENTS</h4>
    209 <blockquote>
    210 <p>Default.</p>
    211 </blockquote>
    212 <h4 class="mansect"><a name="tag_20_14_10" id="tag_20_14_10"></a>STDOUT</h4>
    213 <blockquote>
    214 <p>If a non-empty directory name from <i>CDPATH</i> is used, or if the operand <tt>'-'</tt> is used, and the absolute pathname of
    215 the new working directory can be determined, that pathname shall be written to the standard output as follows:</p>
    216 <pre>
    217 <tt>"%s\n", &lt;</tt><i>new directory</i><tt>&gt;
    218 </tt></pre>
    219 <p>If an absolute pathname of the new current working directory cannot be determined, it is unspecified whether nothing is written
    220 to the standard output or the value of <b>curpath</b> used in step 10, followed by a &lt;newline&gt;, is written to the standard
    221 output.</p>
    222 <p>If a non-empty directory name from <i>CDPATH</i> is not used, and the directory argument is not <tt>'-'</tt>, there shall be no
    223 output.</p>
    224 </blockquote>
    225 <h4 class="mansect"><a name="tag_20_14_11" id="tag_20_14_11"></a>STDERR</h4>
    226 <blockquote>
    227 <p>The standard error shall be used only for diagnostic messages.</p>
    228 </blockquote>
    229 <h4 class="mansect"><a name="tag_20_14_12" id="tag_20_14_12"></a>OUTPUT FILES</h4>
    230 <blockquote>
    231 <p>None.</p>
    232 </blockquote>
    233 <h4 class="mansect"><a name="tag_20_14_13" id="tag_20_14_13"></a>EXTENDED DESCRIPTION</h4>
    234 <blockquote>
    235 <p>None.</p>
    236 </blockquote>
    237 <h4 class="mansect"><a name="tag_20_14_14" id="tag_20_14_14"></a>EXIT STATUS</h4>
    238 <blockquote>
    239 <p>The following exit values shall be returned:</p>
    240 <dl compact>
    241 <dd></dd>
    242 <dt>&nbsp;0</dt>
    243 <dd>The current working directory was successfully changed and the value of the <i>PWD</i> environment variable was set
    244 correctly.</dd>
    245 <dt>&nbsp;0</dt>
    246 <dd>The current working directory was successfully changed, the <b>-e</b> option is not in effect, the <b>-P</b> option is in
    247 effect, and the correct value of the <i>PWD</i> environment variable could not be determined.</dd>
    248 <dt>&gt;0</dt>
    249 <dd>Either the <b>-e</b> option or the <b>-P</b> option is not in effect, and an error occurred.</dd>
    250 <dt>&nbsp;1</dt>
    251 <dd>The current working directory was successfully changed, both the <b>-e</b> and the <b>-P</b> options are in effect, and the
    252 correct value of the <i>PWD</i> environment variable could not be determined.</dd>
    253 <dt>&gt;1</dt>
    254 <dd>Both the <b>-e</b> and the <b>-P</b> options are in effect, and an error occurred.</dd>
    255 </dl>
    256 </blockquote>
    257 <h4 class="mansect"><a name="tag_20_14_15" id="tag_20_14_15"></a>CONSEQUENCES OF ERRORS</h4>
    258 <blockquote>
    259 <p>The working directory shall remain unchanged.</p>
    260 </blockquote>
    261 <hr>
    262 <div class="box"><em>The following sections are informative.</em></div>
    263 <h4 class="mansect"><a name="tag_20_14_16" id="tag_20_14_16"></a>APPLICATION USAGE</h4>
    264 <blockquote>
    265 <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>
    266 for details.</p>
    267 <p>Since <i>cd</i> affects the current shell execution environment, it is always provided as a shell regular built-in. If it is
    268 called in a subshell or separate utility execution environment, such as one of the following:</p>
    269 <pre>
    270 <tt>(cd /tmp)
    271 nohup cd
    272 find . -exec cd {} \;
    273 </tt></pre>
    274 <p>it does not affect the working directory of the caller's environment.</p>
    275 <p>The user must have execute (search) permission in <i>directory</i> in order to change to it.</p>
    276 <p>Since <i>cd</i> treats the operand <tt>'-'</tt> as a special case, applications should not pass arbitrary values as the operand.
    277 For example, instead of:</p>
    278 <pre>
    279 <tt>CDPATH= cd -P -- "$dir"
    280 </tt></pre>
    281 <p>applications should use the following:</p>
    282 <pre>
    283 <tt>case $dir in
    284 (/*) cd -P "$dir";;
    285 ("") echo &gt;&amp;2 directory is an empty string; exit 1;;
    286 (*) CDPATH= cd -P "./$dir";;
    287 esac
    288 </tt></pre>
    289 <p>If an absolute pathname of the new current working directory cannot be determined, and a non-empty directory name from
    290 <i>CDPATH</i> is used, <i>cd</i> may write a pathname to standard output that is not an absolute pathname.</p>
    291 </blockquote>
    292 <h4 class="mansect"><a name="tag_20_14_17" id="tag_20_14_17"></a>EXAMPLES</h4>
    293 <blockquote>
    294 <p>The following template can be used to perform processing in the directory specified by <i>location</i> and end up in the current
    295 working directory in use before the first <i>cd</i> command was issued:</p>
    296 <pre>
    297 <tt>cd </tt><i>location</i><tt>
    298 if [ $? -ne 0 ]
    299 then
    300     print error message
    301     exit 1
    302 fi
    303 ... do whatever is desired as long as the OLDPWD environment variable
    304     is not modified
    305 cd -
    306 </tt></pre></blockquote>
    307 <h4 class="mansect"><a name="tag_20_14_18" id="tag_20_14_18"></a>RATIONALE</h4>
    308 <blockquote>
    309 <p>The use of the <i>CDPATH</i> was introduced in the System V shell. Its use is analogous to the use of the <i>PATH</i> variable
    310 in the shell. The BSD C shell used a shell parameter <i>cdpath</i> for this purpose.</p>
    311 <p>A common extension when <i>HOME</i> is undefined is to get the login directory from the user database for the invoking user.
    312 This does not occur on System V implementations.</p>
    313 <p>Some historical shells, such as the KornShell, took special actions when the directory name contained a dot-dot component,
    314 selecting the logical parent of the directory, rather than the actual parent directory; that is, it moved up one level toward the
    315 <tt>'/'</tt> in the pathname, remembering what the user typed, rather than performing the equivalent of:</p>
    316 <pre>
    317 <tt>chdir("..");
    318 </tt></pre>
    319 <p>In such a shell, the following commands would not necessarily produce equivalent output for all directories:</p>
    320 <pre>
    321 <tt>cd .. &amp;& ls      ls ..
    322 </tt></pre>
    323 <p>This behavior is now the default. It is not consistent with the definition of dot-dot in most historical practice; that is,
    324 while this behavior has been optionally available in the KornShell, other shells have historically not supported this
    325 functionality. The logical pathname is stored in the <i>PWD</i> environment variable when the <i>cd</i> utility completes and this
    326 value is used to construct the next directory name if <i>cd</i> is invoked with the <b>-L</b> option.</p>
    327 <p>When the <b>-P</b> option is in effect, the correct value of the <i>PWD</i> environment variable cannot be determined on some
    328 systems, but still results in a zero exit status. The value of <i>PWD</i> doesn't matter to some shell scripts and in those cases
    329 this is not a problem. In other cases, especially with multiple calls to <i>cd</i>, the values of <i>PWD</i> and <i>OLDPWD</i> are
    330 important but the standard provided no easy way to know that this was the case. The <b>-e</b> option has been added, even though
    331 this was not historic practice, to give script writers a reliable way to know when the value of <i>PWD</i> is not reliable.</p>
    332 </blockquote>
    333 <h4 class="mansect"><a name="tag_20_14_19" id="tag_20_14_19"></a>FUTURE DIRECTIONS</h4>
    334 <blockquote>
    335 <p>If this utility is directed to display a pathname that contains any bytes that have the encoded value of a &lt;newline&gt;
    336 character when &lt;newline&gt; is a terminator or separator in the output format being used, implementations are encouraged to
    337 treat this as an error. A future version of this standard may require implementations to treat this as an error.</p>
    338 </blockquote>
    339 <h4 class="mansect"><a name="tag_20_14_20" id="tag_20_14_20"></a>SEE ALSO</h4>
    340 <blockquote>
    341 <p><a href="../utilities/V3_chap02.html#tag_19_13"><i>2.13 Shell Execution Environment</i></a> , <a href=
    342 "../utilities/pwd.html#"><i>pwd</i></a></p>
    343 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    344 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    345 <p>XSH <a href="../functions/chdir.html#"><i>chdir</i></a></p>
    346 </blockquote>
    347 <h4 class="mansect"><a name="tag_20_14_21" id="tag_20_14_21"></a>CHANGE HISTORY</h4>
    348 <blockquote>
    349 <p>First released in Issue 2.</p>
    350 </blockquote>
    351 <h4 class="mansect"><a name="tag_20_14_22" id="tag_20_14_22"></a>Issue 6</h4>
    352 <blockquote>
    353 <p>The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:</p>
    354 <ul>
    355 <li>
    356 <p>The <i>cd</i> <b>-</b> operand, <i>PWD ,</i> and <i>OLDPWD</i> are added.</p>
    357 </li>
    358 </ul>
    359 <p>The <b>-L</b> and <b>-P</b> options are added to align with the IEEE&nbsp;P1003.2b draft standard. This also includes the
    360 introduction of a new description to include the effect of these options.<br></p>
    361 <p>IEEE&nbsp;Std&nbsp;1003.1-2001/Cor&nbsp;1-2002, item XCU/TC1/D6/14 is applied, changing the SYNOPSIS to make it clear that the
    362 <b>-L</b> and <b>-P</b> options are mutually-exclusive.</p>
    363 </blockquote>
    364 <h4 class="mansect"><a name="tag_20_14_23" id="tag_20_14_23"></a>Issue 7</h4>
    365 <blockquote>
    366 <p>Austin Group Interpretation 1003.1-2001 #037 is applied.</p>
    367 <p>Austin Group Interpretation 1003.1-2001 #199 is applied, clarifying how the <i>cd</i> utility handles concatenation of two
    368 pathnames when the first pathname ends in a &lt;slash&gt; character.</p>
    369 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p>
    370 <p>Step 7 of the processing performed by <i>cd</i> is revised to refer to <b>curpath</b> instead of &quot;the operand&quot;.</p>
    371 <p>Changes to the <a href="../utilities/pwd.html"><i>pwd</i></a> utility and <i>PWD</i> environment variable have been made to
    372 match the changes to the <a href="../functions/getcwd.html"><i>getcwd</i>()</a> function made for Austin Group Interpretation
    373 1003.1-2001 #140.</p>
    374 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0076 [230], XCU/TC1-2008/0077 [240], XCU/TC1-2008/0078 [240], and
    375 XCU/TC1-2008/0079 [123] are applied.</p>
    376 <p>POSIX.1-2008, Technical Corrigendum 2, XCU/TC2-2008/0074 [584] is applied.</p>
    377 </blockquote>
    378 <h4 class="mansect"><a name="tag_20_14_24" id="tag_20_14_24"></a>Issue 8</h4>
    379 <blockquote>
    380 <p>Austin Group Defect 251 is applied, encouraging implementations to report an error if a utility is directed to display a
    381 pathname that contains any bytes that have the encoded value of a &lt;newline&gt; character when &lt;newline&gt; is a terminator or
    382 separator in the output format being used.</p>
    383 <p>Austin Group Defect 253 is applied, adding the <b>-e</b> option.</p>
    384 <p>Austin Group Defect 854 is applied, adding a note to the APPLICATION USAGE section that this utility is required to be
    385 intrinsic.</p>
    386 <p>Austin Group Defect 1045 is applied, clarifying the behavior when the <i>directory</i> operand is <tt>'-'</tt>.</p>
    387 <p>Austin Group Defect 1047 is applied, requiring <i>cd</i> to treat an empty <i>directory</i> operand as an error</p>
    388 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    389 <p>Austin Group Defect 1527 is applied, clarifying the behavior when an absolute pathname of the new current working directory
    390 cannot be determined.</p>
    391 <p>Austin Group Defect 1601 is applied, clarifying that when setting <i>OLDPWD ,</i> the shell need not cause it to be exported if
    392 it was not already.</p>
    393 </blockquote>
    394 <div class="box"><em>End of informative text.</em></div>
    395 <hr>
    396 <p>&nbsp;</p>
    397 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    398 <hr size="2" noshade>
    399 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    400 POSIX™ is a Trademark of The IEEE.<br>
    401 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    402 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    403 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    404 ]</font></center>
    405 <hr size="2" noshade>
    406 <div class="NAVHEADER">
    407 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    408 <tr class="nav">
    409 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/cat.html" accesskey="P">&lt;&lt;&lt;
    410 Previous</a></td>
    411 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    412 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/cflow.html" accesskey="N">Next
    413 &gt;&gt;&gt;</a></td>
    414 </tr>
    415 </table>
    416 <hr align="left" width="100%"></div>
    417 </body>
    418 </html>