isposix

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

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

sh.html (75405B)


      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>sh</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/sed.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/sleep.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="sh" id="sh"></a> <a name="tag_20_110" id="tag_20_110"></a><!-- sh -->
     29 <h4 class="mansect"><a name="tag_20_110_01" id="tag_20_110_01"></a>NAME</h4>
     30 <blockquote>sh — shell, the standard command language interpreter</blockquote>
     31 <h4 class="mansect"><a name="tag_20_110_02" id="tag_20_110_02"></a>SYNOPSIS</h4>
     32 <blockquote class="synopsis">
     33 <p><code><tt><sup>[<a href="javascript:open_code('OB')">OB</a>]</sup> sh</tt> <b>[</b><tt>-abCef<img src="../images/opt-start.gif"
     34 border="0">h<img src="../images/opt-end.gif" border="0">imnuvx</tt><b>] [</b><tt>-o</tt> <i>option</i><b>]</b><tt>...</tt>
     35 <b>[</b><tt>+abCef<img src="../images/opt-start.gif" border="0">h<img src="../images/opt-end.gif" border="0">imnuvx</tt><b>]
     36 [</b><tt>+o</tt> <i>option</i><b>]</b><tt>...<br>
     37 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <b>[</b><i>command_file</i> <b>[</b><i>argument</i><tt>...</tt><b>]]</b> <tt><br>
     38 <br>
     39 <sup>[<a href="javascript:open_code('OB')">OB</a>]</sup> sh -c</tt> <b>[</b><tt>-abCef<img src="../images/opt-start.gif" border=
     40 "0">h<img src="../images/opt-end.gif" border="0">imnuvx</tt><b>] [</b><tt>-o</tt> <i>option</i><b>]</b><tt>...</tt>
     41 <b>[</b><tt>+abCef<img src="../images/opt-start.gif" border="0">h<img src="../images/opt-end.gif" border="0">imnuvx</tt><b>]
     42 [</b><tt>+o</tt> <i>option</i><b>]</b><tt>...<br>
     43 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <i>command_string</i> <b>[</b><i>command_name</i>
     44 <b>[</b><i>argument</i><tt>...</tt><b>]]</b> <tt><br>
     45 <br>
     46 <sup>[<a href="javascript:open_code('OB')">OB</a>]</sup> sh -s</tt> <b>[</b><tt>-abCef<img src="../images/opt-start.gif" border=
     47 "0">h<img src="../images/opt-end.gif" border="0">imnuvx</tt><b>] [</b><tt>-o</tt> <i>option</i><b>]</b><tt>...</tt>
     48 <b>[</b><tt>+abCef<img src="../images/opt-start.gif" border="0">h<img src="../images/opt-end.gif" border="0">imnuvx</tt><b>]
     49 [</b><tt>+o</tt> <i>option</i><b>]</b><tt>...<br>
     50 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt> <b>[</b><i>argument</i><tt>...</tt><b>]</b> <tt><br></tt></code></p>
     51 </blockquote>
     52 <h4 class="mansect"><a name="tag_20_110_03" id="tag_20_110_03"></a>DESCRIPTION</h4>
     53 <blockquote>
     54 <p>The <i>sh</i> utility is a command language interpreter that shall execute commands read from a command line string, the
     55 standard input, or a specified file. The application shall ensure that the commands to be executed are expressed in the language
     56 described in <a href="../utilities/V3_chap02.html#tag_19"><i>2. Shell Command Language</i></a> .</p>
     57 <p>Pathname expansion shall not fail due to the size of a file.</p>
     58 <p>Shell input and output redirections have an implementation-defined offset maximum that is established in the open file
     59 description.</p>
     60 </blockquote>
     61 <h4 class="mansect"><a name="tag_20_110_04" id="tag_20_110_04"></a>OPTIONS</h4>
     62 <blockquote>
     63 <p>The <i>sh</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     64 Guidelines</i></a> , with an extension for support of a leading &lt;plus-sign&gt; (<tt>'+'</tt>) as noted below.</p>
     65 <p>The <b>-a</b>, <b>-b</b>, <b>-C</b>, <b>-e</b>, <b>-f</b>, <b>-h</b>, <b>-m</b>, <b>-n</b>, <b>-o</b> <i>option</i>, <b>-u</b>,
     66 <b>-v</b>, and <b>-x</b> options are described as part of the <a href="../utilities/V3_chap02.html#set"><i>set</i></a> utility in
     67 <a href="../utilities/V3_chap02.html#tag_19_15"><i>2.15 Special Built-In Utilities</i></a> . The option letters derived from the
     68 <a href="../utilities/V3_chap02.html#set"><i>set</i></a> special built-in shall also be accepted with a leading &lt;plus-sign&gt;
     69 (<tt>'+'</tt>) instead of a leading &lt;hyphen-minus&gt; (meaning the reverse case of the option as described in this volume of
     70 POSIX.1-2024). If the <b>-o</b> or <b>+o</b> option is specified without an option-argument, the behavior is unspecified.</p>
     71 <p>The following additional options shall be supported:</p>
     72 <dl compact>
     73 <dd></dd>
     74 <dt><b>-c</b></dt>
     75 <dd>Read commands from the <i>command_string</i> operand. Set the value of special parameter 0 (see <a href=
     76 "../utilities/V3_chap02.html#tag_19_05_02"><i>2.5.2 Special Parameters</i></a> ) from the value of the <i>command_name</i> operand
     77 and the positional parameters ($1, $2, and so on) in sequence from the remaining <i>argument</i> operands. No commands shall be
     78 read from the standard input.</dd>
     79 <dt><b>-i</b></dt>
     80 <dd>Specify that the shell is <i>interactive</i>; see below. An implementation may treat specifying the <b>-i</b> option as an
     81 error if the real user ID of the calling process does not equal the effective user ID or if the real group ID does not equal the
     82 effective group ID.</dd>
     83 <dt><b>-s</b></dt>
     84 <dd>Read commands from the standard input.</dd>
     85 </dl>
     86 <p>If there are no operands and the <b>-c</b> option is not specified, the <b>-s</b> option shall be assumed.</p>
     87 <p>If the <b>-i</b> option is present, or if the shell reads commands from the standard input and the shell's standard input and
     88 standard error are attached to a terminal, the shell is considered to be <i>interactive</i>.</p>
     89 </blockquote>
     90 <h4 class="mansect"><a name="tag_20_110_05" id="tag_20_110_05"></a>OPERANDS</h4>
     91 <blockquote>
     92 <p>The following operands shall be supported:</p>
     93 <dl compact>
     94 <dd></dd>
     95 <dt><tt>-</tt></dt>
     96 <dd>A single &lt;hyphen-minus&gt; shall be treated as the first operand and then ignored. If both <tt>'-'</tt> and <tt>"--"</tt>
     97 are given as arguments, or if other operands precede the single &lt;hyphen-minus&gt;, the results are undefined.</dd>
     98 <dt><i>argument</i></dt>
     99 <dd>The positional parameters ($1, $2, and so on) shall be set to <i>arguments</i>, if any.</dd>
    100 <dt><i>command_file</i></dt>
    101 <dd>The pathname of a file containing commands. If the pathname contains one or more &lt;slash&gt; characters, the implementation
    102 attempts to read that file; the file need not be executable. If the pathname does not contain a &lt;slash&gt; character:
    103 <ul>
    104 <li>
    105 <p>The implementation shall attempt to read that file from the current working directory; the file need not be executable.</p>
    106 </li>
    107 <li>
    108 <p>If the file is not in the current working directory, the implementation may perform a search for an executable file using the
    109 value of <i>PATH ,</i> as described in <a href="../utilities/V3_chap02.html#tag_19_09_01_04"><i>2.9.1.4 Command Search and
    110 Execution</i></a> .</p>
    111 </li>
    112 </ul>
    113 <p>Special parameter 0 (see <a href="../utilities/V3_chap02.html#tag_19_05_02"><i>2.5.2 Special Parameters</i></a> ) shall be set
    114 to the value of <i>command_file</i>. If <i>sh</i> is called using a synopsis form that omits <i>command_file</i>, special parameter
    115 0 shall be set to the value of the first argument passed to <i>sh</i> from its parent (for example, <i>argv</i>[0] for a C
    116 program), which is normally a pathname used to execute the <i>sh</i> utility.</p>
    117 </dd>
    118 <dt><i>command_name</i></dt>
    119 <dd><br>
    120 A string assigned to special parameter 0 when executing the commands in <i>command_string</i>. If <i>command_name</i> is not
    121 specified, special parameter 0 shall be set to the value of the first argument passed to <i>sh</i> from its parent (for example,
    122 <i>argv</i>[0] for a C program), which is normally a pathname used to execute the <i>sh</i> utility.</dd>
    123 <dt><i>command_string</i></dt>
    124 <dd><br>
    125 A string that shall be interpreted by the shell as one or more commands, as if the string were the argument to the <a href=
    126 "../functions/system.html"><i>system</i>()</a> function defined in the System Interfaces volume of POSIX.1-2024. If the
    127 <i>command_string</i> operand is an empty string, <i>sh</i> shall exit with a zero exit status.</dd>
    128 </dl>
    129 </blockquote>
    130 <h4 class="mansect"><a name="tag_20_110_06" id="tag_20_110_06"></a>STDIN</h4>
    131 <blockquote>
    132 <p>The standard input shall be used only if one of the following is true:</p>
    133 <ul>
    134 <li>
    135 <p>The <b>-s</b> option is specified.</p>
    136 </li>
    137 <li>
    138 <p>The <b>-c</b> option is not specified and no operands are specified.</p>
    139 </li>
    140 <li>
    141 <p>The script executes one or more commands that require input from standard input (such as a <a href=
    142 "../utilities/read.html"><i>read</i></a> command that does not redirect its input).</p>
    143 </li>
    144 </ul>
    145 <p>See the INPUT FILES section.</p>
    146 <p>When the shell is using standard input and it invokes a command that also uses standard input, the shell shall ensure that the
    147 standard input file pointer points directly after the command it has read when the command begins execution. It shall not read
    148 ahead in such a manner that any characters intended to be read by the invoked command are consumed by the shell (whether
    149 interpreted by the shell or not) or that characters that are not read by the invoked command are not seen by the shell. When the
    150 command expecting to read standard input is started asynchronously by an interactive shell, it is unspecified whether characters
    151 are read by the command or interpreted by the shell.</p>
    152 <p>If the standard input to <i>sh</i> is a FIFO or terminal device and is set to non-blocking reads, then <i>sh</i> shall enable
    153 blocking reads on standard input. This shall remain in effect when the command completes.</p>
    154 </blockquote>
    155 <h4 class="mansect"><a name="tag_20_110_07" id="tag_20_110_07"></a>INPUT FILES</h4>
    156 <blockquote>
    157 <p>The input file can be of any type, but the initial portion of the file intended to be parsed according to the shell grammar (see
    158 <a href="../utilities/V3_chap02.html#tag_19_10_02"><i>2.10.2 Shell Grammar Rules</i></a> ) shall consist of characters and shall
    159 not contain the NUL character. The shell shall not enforce any line length limits. If the input file consists solely of zero or
    160 more blank lines and comments, <i>sh</i> shall exit with a zero exit status.</p>
    161 </blockquote>
    162 <h4 class="mansect"><a name="tag_20_110_08" id="tag_20_110_08"></a>ENVIRONMENT VARIABLES</h4>
    163 <blockquote>
    164 <p>The following environment variables shall affect the execution of <i>sh</i>:</p>
    165 <dl compact>
    166 <dd></dd>
    167 <dt><i>ENV</i></dt>
    168 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    169 This variable, when and only when an interactive shell is invoked, shall be subjected to parameter expansion (see <a href=
    170 "../utilities/V3_chap02.html#tag_19_06_02"><i>2.6.2 Parameter Expansion</i></a> ) by the shell, and the resulting value shall be
    171 used as a pathname of a file containing shell commands to execute in the current environment. The file need not be executable. If
    172 the expanded value of <i>ENV</i> is not an absolute pathname, the results are unspecified. <i>ENV</i> shall be ignored if the real
    173 and effective user IDs or real and effective group IDs of the process are different. The file specified by <i>ENV</i> need not be
    174 processed if the file can be written by any user other than the user identified by the real (and effective) user ID of the shell
    175 process. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    176 <dt><i>FCEDIT</i></dt>
    177 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    178 This variable, when expanded by the shell, shall determine the default value for the <b>-e</b> <i>editor</i> option's <i>editor</i>
    179 option-argument. If <i>FCEDIT</i> is null or unset, <a href="../utilities/ed.html"><i>ed</i></a> shall be used as the editor.
    180 <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    181 <dt><i>HISTFILE</i></dt>
    182 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    183 Determine a pathname naming a command history file. If the <i>HISTFILE</i> variable is not set, the shell may attempt to access or
    184 create a file <b>.sh_history</b> in the directory referred to by the <i>HOME</i> environment variable. If the shell cannot obtain
    185 both read and write access to, or create, the history file, it shall use an unspecified mechanism that allows the history to
    186 operate properly. (References to history &quot;file&quot; in this section shall be understood to mean this unspecified mechanism in such
    187 cases.) An implementation may choose to access this variable only when initializing the history file; this initialization shall
    188 occur when <a href="../utilities/fc.html"><i>fc</i></a> or <i>sh</i> first attempt to retrieve entries from, or add entries to, the
    189 file, as the result of commands issued by the user, the file named by the <i>ENV</i> variable, or implementation-defined system
    190 start-up files. Implementations may choose to disable the history list mechanism for users with appropriate privileges who do not
    191 set <i>HISTFILE ;</i> the specific circumstances under which this occurs are implementation-defined. If more than one instance of
    192 the shell is using the same history file, it is unspecified how updates to the history file from those shells interact. As entries
    193 are deleted from the history file, they shall be deleted oldest first. It is unspecified when history file entries are physically
    194 removed from the history file. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    195 <dt><i>HISTSIZE</i></dt>
    196 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    197 Determine a decimal number representing the limit to the number of previous commands that are accessible. If this variable is
    198 unset, an unspecified default greater than or equal to 128 shall be used. The maximum number of commands in the history list is
    199 unspecified, but shall be at least 128. An implementation may choose to access this variable only when initializing the history
    200 file, as described under <i>HISTFILE .</i> Therefore, it is unspecified whether changes made to <i>HISTSIZE</i> after the history
    201 file has been initialized are effective. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    202 <dt><i>HOME</i></dt>
    203 <dd>Determine the pathname of the user's home directory. The contents of <i>HOME</i> are used in tilde expansion as described in
    204 <a href="../utilities/V3_chap02.html#tag_19_06_01"><i>2.6.1 Tilde Expansion</i></a> .</dd>
    205 <dt><i>LANG</i></dt>
    206 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
    207 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
    208 variables used to determine the values of locale categories.)</dd>
    209 <dt><i>LC_ALL</i></dt>
    210 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
    211 <dt><i>LC_COLLATE</i></dt>
    212 <dd><br>
    213 Determine the behavior of range expressions, equivalence classes, and multi-character collating elements within pattern
    214 matching.</dd>
    215 <dt><i>LC_CTYPE</i></dt>
    216 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
    217 opposed to multi-byte characters in arguments and input files), which characters are defined as letters (character class
    218 <b>alpha</b>), and the behavior of character classes within pattern matching.</dd>
    219 <dt><i>LC_MESSAGES</i></dt>
    220 <dd><br>
    221 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd>
    222 <dt><i>MAIL</i></dt>
    223 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    224 Determine a pathname of the user's mailbox file for purposes of incoming mail notification. If this variable is set, the shell
    225 shall inform the user if the file named by the variable is created or if its modification time has changed. Informing the user
    226 shall be accomplished by writing a string of unspecified format to standard error prior to the writing of the next primary prompt
    227 string. Such check shall be performed only after the completion of the interval defined by the <i>MAILCHECK</i> variable after the
    228 last such check. The user shall be informed only if <i>MAIL</i> is set and <i>MAILPATH</i> is not set. <img src=
    229 "../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    230 <dt><i>MAILCHECK</i></dt>
    231 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border=
    232 "0"><br>
    233 Establish a decimal integer value that specifies how often (in seconds) the shell shall check for the arrival of mail in the files
    234 specified by the <i>MAILPATH</i> or <i>MAIL</i> variables. The default value shall be 600 seconds. If set to zero, the shell shall
    235 check before issuing each primary prompt. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
    236 <dt><i>MAILPATH</i></dt>
    237 <dd><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    238 Provide a list of pathnames and optional messages separated by &lt;colon&gt; characters. If this variable is set, the shell shall
    239 inform the user if any of the files named by the variable are created or if any of their modification times change. (See the
    240 preceding entry for <i>MAIL</i> for descriptions of mail arrival and user informing.) Each pathname can be followed by <tt>'%'</tt>
    241 and a string that shall be subjected to parameter expansion and written to standard error when the modification time changes. If a
    242 <tt>'%'</tt> character in the pathname is preceded by a &lt;backslash&gt;, it shall be treated as a literal <tt>'%'</tt> in the
    243 pathname. The default message is unspecified.
    244 <p>The <i>MAILPATH</i> environment variable takes precedence over the <i>MAIL</i> variable. <img src="../images/opt-end.gif" alt=
    245 "[Option End]" border="0"></p>
    246 </dd>
    247 <dt><i>NLSPATH</i></dt>
    248 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
    249 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
    250 "0"></dd>
    251 <dt><i>PATH</i></dt>
    252 <dd>Establish a string formatted as described in XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment
    253 Variables</i></a> , used to effect command interpretation; see <a href="../utilities/V3_chap02.html#tag_19_09_01_04"><i>2.9.1.4
    254 Command Search and Execution</i></a> .</dd>
    255 <dt><i>PWD</i></dt>
    256 <dd>This variable shall represent an absolute pathname of the current working directory. Assignments to this variable may be
    257 ignored.</dd>
    258 </dl>
    259 </blockquote>
    260 <h4 class="mansect"><a name="tag_20_110_09" id="tag_20_110_09"></a>ASYNCHRONOUS EVENTS</h4>
    261 <blockquote>
    262 <p>The <i>sh</i> utility shall take the standard action for all signals (see <a href="../utilities/V3_chap01.html#tag_18_04"><i>1.4
    263 Utility Description Defaults</i></a> ) with the following exceptions.</p>
    264 <p>If the shell is interactive, SIGINT signals received during command line editing shall be handled as described in the EXTENDED
    265 DESCRIPTION, and SIGINT signals received at other times shall be caught but no action performed.<br></p>
    266 <p>If the shell is interactive:</p>
    267 <ul>
    268 <li>
    269 <p>SIGQUIT and SIGTERM signals shall be ignored.</p>
    270 </li>
    271 <li>
    272 <p>If the <b>-m</b> option is in effect, SIGTTIN, SIGTTOU, and SIGTSTP signals shall be ignored.</p>
    273 </li>
    274 <li>
    275 <p>If the <b>-m</b> option is not in effect, it is unspecified whether SIGTTIN, SIGTTOU, and SIGTSTP signals are ignored, set to
    276 the default action, or caught. If they are caught, the shell shall, in the signal-catching function, set the signal to the default
    277 action and raise the signal (after taking any appropriate steps, such as restoring terminal settings).</p>
    278 </li>
    279 </ul>
    280 <p>The standard actions, and the actions described above for interactive shells, can be overridden by use of the <a href=
    281 "../utilities/trap.html"><i>trap</i></a> special built-in utility (see <a href=
    282 "../utilities/V3_chap02.html#tag_19_29"><i>trap</i></a> and <a href="../utilities/V3_chap02.html#tag_19_12"><i>2.12 Signals and
    283 Error Handling</i></a> ).</p>
    284 </blockquote>
    285 <h4 class="mansect"><a name="tag_20_110_10" id="tag_20_110_10"></a>STDOUT</h4>
    286 <blockquote>
    287 <p>See the STDERR section.</p>
    288 </blockquote>
    289 <h4 class="mansect"><a name="tag_20_110_11" id="tag_20_110_11"></a>STDERR</h4>
    290 <blockquote>
    291 <p>Except as otherwise stated (by the descriptions of any invoked utilities or in interactive mode), standard error shall be used
    292 only for diagnostic messages.</p>
    293 </blockquote>
    294 <h4 class="mansect"><a name="tag_20_110_12" id="tag_20_110_12"></a>OUTPUT FILES</h4>
    295 <blockquote>
    296 <p>None.</p>
    297 </blockquote>
    298 <h4 class="mansect"><a name="tag_20_110_13" id="tag_20_110_13"></a>EXTENDED DESCRIPTION</h4>
    299 <blockquote>
    300 <p>See <a href="../utilities/V3_chap02.html#tag_19"><i>2. Shell Command Language</i></a> . <sup>[<a href=
    301 "javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> &nbsp;The
    302 functionality described in the rest of the EXTENDED DESCRIPTION section shall be provided on implementations that support the User
    303 Portability Utilities option (and the rest of this section is not further shaded for this option). <img src="../images/opt-end.gif"
    304 alt="[Option End]" border="0"></p>
    305 <h5><a name="tag_20_110_13_01" id="tag_20_110_13_01"></a>Command History List</h5>
    306 <p>When the <i>sh</i> utility is being used interactively, it shall maintain a list of commands previously entered from the
    307 terminal in the file named by the <i>HISTFILE</i> environment variable. The type, size, and internal format of this file are
    308 unspecified. Multiple <i>sh</i> processes can share access to the file for a user, if file access permissions allow this; see the
    309 description of the <i>HISTFILE</i> environment variable.</p>
    310 <h5><a name="tag_20_110_13_02" id="tag_20_110_13_02"></a>Command Line Editing</h5>
    311 <p>When <i>sh</i> is being used interactively from a terminal, the current command and the command history (see <a href=
    312 "../utilities/fc.html#"><i>fc</i></a> ) can be edited using <a href="../utilities/vi.html"><i>vi</i></a>-mode command line editing.
    313 This mode uses commands, described below, similar to a subset of those described in the <a href=
    314 "../utilities/vi.html"><i>vi</i></a> utility. Implementations may offer other command line editing modes corresponding to other
    315 editing utilities.</p>
    316 <p>The command <a href="../utilities/V3_chap02.html#set"><i>set</i></a> <b>-o</b> <a href="../utilities/vi.html"><i>vi</i></a>
    317 shall enable <a href="../utilities/vi.html"><i>vi</i></a>-mode editing and place <i>sh</i> into <a href=
    318 "../utilities/vi.html"><i>vi</i></a> insert mode (see <a href="#tag_20_110_13_03">Command Line Editing (vi-mode)</a> ). This
    319 command also shall disable any other editing mode that the implementation may provide. The command <a href=
    320 "../utilities/V3_chap02.html#set"><i>set</i></a> <b>+o</b> <a href="../utilities/vi.html"><i>vi</i></a> disables <a href=
    321 "../utilities/vi.html"><i>vi</i></a>-mode editing.</p>
    322 <p>Certain block-mode terminals may be unable to support shell command line editing. If a terminal is unable to provide either edit
    323 mode, it need not be possible to <a href="../utilities/V3_chap02.html#set"><i>set</i></a> <b>-o</b> <a href=
    324 "../utilities/vi.html"><i>vi</i></a> when using the shell on this terminal.</p>
    325 <p>In the following sections, the characters <i>erase</i>, <i>interrupt</i>, <i>kill</i>, and <i>end-of-file</i> are those set by
    326 the <a href="../utilities/stty.html"><i>stty</i></a> utility.</p>
    327 <h5><a name="tag_20_110_13_03" id="tag_20_110_13_03"></a>Command Line Editing (vi-mode)</h5>
    328 <p>In <a href="../utilities/vi.html"><i>vi</i></a> editing mode, there shall be a distinguished line, the edit line. All the
    329 editing operations which modify a line affect the edit line. The edit line is always the newest line in the command history
    330 buffer.</p>
    331 <p>With <a href="../utilities/vi.html"><i>vi</i></a>-mode enabled, <i>sh</i> can be switched between insert mode and command
    332 mode.</p>
    333 <p>When in insert mode, an entered character shall be inserted into the command line, except as noted in <a href=
    334 "#tag_20_110_13_04">vi Line Editing Insert Mode</a> . Upon entering <i>sh</i> and after termination of the previous command,
    335 <i>sh</i> shall be in insert mode.</p>
    336 <p>Typing an escape character shall switch <i>sh</i> into command mode (see <a href="#tag_20_110_13_05">vi Line Editing Command
    337 Mode</a> ). In command mode, an entered character shall either invoke a defined operation, be used as part of a multi-character
    338 operation, or be treated as an error. A character that is not recognized as part of an editing command shall terminate any specific
    339 editing command and shall alert the terminal. If <i>sh</i> receives a SIGINT signal in command mode (whether generated by typing
    340 the <i>interrupt</i> character or by other means), it shall terminate command line editing on the current command line, reissue the
    341 prompt on the next line of the terminal, and reset the command history (see <a href="../utilities/fc.html#"><i>fc</i></a> ) so that
    342 the most recently executed command is the previous command (that is, the command that was being edited when it was interrupted is
    343 not re-entered into the history).</p>
    344 <p>In the following sections, the phrase &quot;move the cursor to the beginning of the word&quot; shall mean &quot;move the cursor to the first
    345 character of the current word&quot; and the phrase &quot;move the cursor to the end of the word&quot; shall mean &quot;move the cursor to the last
    346 character of the current word&quot;. The phrase &quot;beginning of the command line&quot; indicates the point between the end of the prompt
    347 string issued by the shell (or the beginning of the terminal line, if there is no prompt string) and the first character of the
    348 command text.</p>
    349 <h5><a name="tag_20_110_13_04" id="tag_20_110_13_04"></a>vi Line Editing Insert Mode</h5>
    350 <p>While in insert mode, any character typed shall be inserted in the current command line, unless it is from the following
    351 set.</p>
    352 <dl compact>
    353 <dd></dd>
    354 <dt>&lt;newline&gt;</dt>
    355 <dd>Execute the current command line. If the current command line is not empty, this line shall be entered into the command history
    356 (see <a href="../utilities/fc.html#"><i>fc</i></a> ).</dd>
    357 <dt><i>erase</i></dt>
    358 <dd>Delete the character previous to the current cursor position and move the current cursor position back one character. In insert
    359 mode, characters shall be erased from both the screen and the buffer when backspacing.</dd>
    360 <dt><i>interrupt</i></dt>
    361 <dd>If <i>sh</i> receives a SIGINT signal in insert mode (whether generated by typing the <i>interrupt</i> character or by other
    362 means), it shall terminate command line editing with the same effects as described for interrupting command mode; see <a href=
    363 "#tag_20_110_13_03">Command Line Editing (vi-mode)</a> .</dd>
    364 <dt><i>kill</i></dt>
    365 <dd>Clear all the characters from the input line.</dd>
    366 <dt>&lt;control&gt;-V</dt>
    367 <dd>Insert the next character input, even if the character is otherwise a special insert mode character.</dd>
    368 <dt>&lt;control&gt;-W</dt>
    369 <dd>Delete the characters from the one preceding the cursor to the preceding word boundary. The word boundary in this case is the
    370 closer to the cursor of either the beginning of the line or a character that is in neither the <b>blank</b> nor <b>punct</b>
    371 character classification of the current locale.</dd>
    372 <dt><i>end-of-file</i></dt>
    373 <dd>Interpreted as the end of input in <i>sh</i>. This interpretation shall occur only at the beginning of an input line. If
    374 <i>end-of-file</i> is entered other than at the beginning of the line, the results are unspecified.</dd>
    375 <dt>&lt;ESC&gt;</dt>
    376 <dd>Place <i>sh</i> into command mode.</dd>
    377 </dl>
    378 <h5><a name="tag_20_110_13_05" id="tag_20_110_13_05"></a>vi Line Editing Command Mode</h5>
    379 <p>In command mode for the command line editing feature, decimal digits not beginning with 0 that precede a command letter shall be
    380 remembered. Some commands use these decimal digits as a count number that affects the operation.</p>
    381 <p>The term <i>motion command</i> represents one of the commands:</p>
    382 <pre>
    383 <tt>&lt;space&gt;  0  b  F  l  W  ^  $  ;  E  f  T  w  |  ,  B  e  h  t
    384 </tt></pre>
    385 <p>If the current line is not the edit line, any command that modifies the current line shall cause the content of the current line
    386 to replace the content of the edit line, and the current line shall become the edit line. This replacement cannot be undone (see
    387 the <b>u</b> and <b>U</b> commands below). The modification requested shall then be performed to the edit line. When the current
    388 line is the edit line, the modification shall be done directly to the edit line.</p>
    389 <p>Any command that is preceded by <i>count</i> shall take a count (the numeric value of any preceding decimal digits). Unless
    390 otherwise noted, this count shall cause the specified operation to repeat by the number of times specified by the count. Also
    391 unless otherwise noted, a <i>count</i> that is out of range is considered an error condition and shall alert the terminal, but
    392 neither the cursor position, nor the command line, shall change.</p>
    393 <p>The terms <i>word</i> and <i>bigword</i> are used as defined in the <a href="../utilities/vi.html"><i>vi</i></a> description.
    394 The term <i>save buffer</i> corresponds to the term <i>unnamed buffer</i> in <a href="../utilities/vi.html"><i>vi</i></a>.</p>
    395 <p>The following commands shall be recognized in command mode:</p>
    396 <dl compact>
    397 <dd></dd>
    398 <dt>&lt;newline&gt;</dt>
    399 <dd>Execute the current command line. If the current command line is not empty, this line shall be entered into the command history
    400 (see <a href="../utilities/fc.html#"><i>fc</i></a> ).</dd>
    401 <dt>&lt;control&gt;-L</dt>
    402 <dd>Redraw the current command line. Position the cursor at the same location on the redrawn line.</dd>
    403 <dt><b>#</b></dt>
    404 <dd>Insert the character <tt>'#'</tt> at the beginning of the current command line and treat the resulting edit line as a comment.
    405 This line shall be entered into the command history; see <a href="../utilities/fc.html#"><i>fc</i></a> .</dd>
    406 <dt><b>=</b></dt>
    407 <dd>Display the possible shell word expansions (see <a href="../utilities/V3_chap02.html#tag_19_06"><i>2.6 Word Expansions</i></a>
    408 ) of the bigword at the current command line position. <basefont size="2">
    409 <dl>
    410 <dt><b>Note:</b></dt>
    411 <dd>This does not modify the content of the current line, and therefore does not cause the current line to become the edit
    412 line.</dd>
    413 </dl>
    414 <basefont size="3">
    415 <p>These expansions shall be displayed on subsequent terminal lines. If the bigword contains none of the characters <tt>'?'</tt>,
    416 <tt>'*'</tt>, or <tt>'['</tt>, an &lt;asterisk&gt; (<tt>'*'</tt>) shall be implicitly assumed at the end. If any directories are
    417 matched, these expansions shall have a <tt>'/'</tt> character appended. After the expansion, the line shall be redrawn, the cursor
    418 repositioned at the current cursor position, and <i>sh</i> shall be placed in command mode.</p>
    419 </dd>
    420 <dt><b>\</b></dt>
    421 <dd>Perform pathname expansion (see <a href="../utilities/V3_chap02.html#tag_19_06_06"><i>2.6.6 Pathname Expansion</i></a> ) on the
    422 current bigword, up to the largest set of characters that can be matched uniquely. If the bigword contains none of the characters
    423 <tt>'?'</tt>, <tt>'*'</tt>, or <tt>'['</tt>, an &lt;asterisk&gt; (<tt>'*'</tt>) shall be implicitly assumed at the end. This
    424 maximal expansion then shall replace the original bigword in the command line, and the cursor shall be placed after this expansion.
    425 If the resulting bigword completely and uniquely matches a directory, a <tt>'/'</tt> character shall be inserted directly after the
    426 bigword. If some other file is completely matched, a single &lt;space&gt; shall be inserted after the bigword. After this
    427 operation, <i>sh</i> shall be placed in insert mode.</dd>
    428 <dt><b>*</b></dt>
    429 <dd>Perform pathname expansion on the current bigword and insert all expansions into the command to replace the current bigword,
    430 with each expansion separated by a single &lt;space&gt;. If at the end of the line, the current cursor position shall be moved to
    431 the first column position following the expansions and <i>sh</i> shall be placed in insert mode. Otherwise, the current cursor
    432 position shall be the last column position of the first character after the expansions and <i>sh</i> shall be placed in insert
    433 mode. If the current bigword contains none of the characters <tt>'?'</tt>, <tt>'*'</tt>, or <tt>'['</tt>, before the operation, an
    434 &lt;asterisk&gt; (<tt>'*'</tt>) shall be implicitly assumed at the end.</dd>
    435 <dt><b>@</b><i>letter</i></dt>
    436 <dd>Insert the value of the alias named <i>_letter</i>. The symbol <i>letter</i> represents a single alphabetic character from the
    437 portable character set; implementations may support additional characters as an extension. If the alias <i>_letter</i> contains
    438 other editing commands, these commands shall be performed as part of the insertion. If no alias <i>_letter</i> is enabled, this
    439 command shall have no effect.</dd>
    440 <dt><b>[</b><i>count</i><b>]~</b></dt>
    441 <dd>Convert, if the current character is a lowercase letter, to the equivalent uppercase letter and <i>vice versa</i>, as
    442 prescribed by the current locale. The current cursor position then shall be advanced by one character. If the cursor was positioned
    443 on the last character of the line, the case conversion shall occur, but the cursor shall not advance. If the <tt>'~'</tt> command
    444 is preceded by a <i>count</i>, that number of characters shall be converted, and the cursor shall be advanced to the character
    445 position after the last character converted. If the <i>count</i> is larger than the number of characters after the cursor, this
    446 shall not be considered an error; the cursor shall advance to the last character on the line.</dd>
    447 <dt><b>[</b><i>count</i><b>].</b></dt>
    448 <dd>Repeat the most recent non-motion command, even if it was executed on an earlier command line. If the previous command was
    449 preceded by a <i>count</i>, and no count is given on the <tt>'.'</tt> command, the count from the previous command shall be
    450 included as part of the repeated command. If the <tt>'.'</tt> command is preceded by a <i>count</i>, this shall override any
    451 <i>count</i> argument to the previous command. The <i>count</i> specified in the <tt>'.'</tt> command shall become the count for
    452 subsequent <tt>'.'</tt> commands issued without a count.</dd>
    453 <dt><b>[</b><i>number</i><b>]v</b></dt>
    454 <dd>Invoke the <a href="../utilities/vi.html"><i>vi</i></a> editor to edit the current command line in a temporary file. When the
    455 editor exits, the commands in the temporary file shall be executed and placed in the command history. If a <i>number</i> is
    456 included, it specifies the command number in the command history to be edited, rather than the current command line.</dd>
    457 <dt><b>[</b><i>count</i><b>]l</b>&nbsp;&nbsp;&nbsp;(ell)</dt>
    458 <dd></dd>
    459 <dt><b>[</b><i>count</i><b>]</b>&lt;space&gt;</dt>
    460 <dd><br>
    461 Move the current cursor position to the next character position. If the cursor was positioned on the last character of the line,
    462 the terminal shall be alerted and the cursor shall not be advanced. If the <i>count</i> is larger than the number of characters
    463 after the cursor, this shall not be considered an error; the cursor shall advance to the last character on the line.</dd>
    464 <dt><b>[</b><i>count</i><b>]h</b></dt>
    465 <dd>Move the current cursor position to the <i>count</i>th (default 1) previous character position. If the cursor was positioned on
    466 the first character of the line, the terminal shall be alerted and the cursor shall not be moved. If the count is larger than the
    467 number of characters before the cursor, this shall not be considered an error; the cursor shall move to the first character on the
    468 line.</dd>
    469 <dt><b>[</b><i>count</i><b>]w</b></dt>
    470 <dd>Move to the start of the next word. If the cursor was positioned on the last character of the line, the terminal shall be
    471 alerted and the cursor shall not be advanced. If the <i>count</i> is larger than the number of words after the cursor, this shall
    472 not be considered an error; the cursor shall advance to the last character on the line.</dd>
    473 <dt><b>[</b><i>count</i><b>]W</b></dt>
    474 <dd>Move to the start of the next bigword. If the cursor was positioned on the last character of the line, the terminal shall be
    475 alerted and the cursor shall not be advanced. If the <i>count</i> is larger than the number of bigwords after the cursor, this
    476 shall not be considered an error; the cursor shall advance to the last character on the line.</dd>
    477 <dt><b>[</b><i>count</i><b>]e</b></dt>
    478 <dd>Move to the end of the current word. If at the end of a word, move to the end of the next word. If the cursor was positioned on
    479 the last character of the line, the terminal shall be alerted and the cursor shall not be advanced. If the <i>count</i> is larger
    480 than the number of words after the cursor, this shall not be considered an error; the cursor shall advance to the last character on
    481 the line.</dd>
    482 <dt><b>[</b><i>count</i><b>]E</b></dt>
    483 <dd>Move to the end of the current bigword. If at the end of a bigword, move to the end of the next bigword. If the cursor was
    484 positioned on the last character of the line, the terminal shall be alerted and the cursor shall not be advanced. If the
    485 <i>count</i> is larger than the number of bigwords after the cursor, this shall not be considered an error; the cursor shall
    486 advance to the last character on the line.</dd>
    487 <dt><b>[</b><i>count</i><b>]b</b></dt>
    488 <dd>Move to the beginning of the current word. If at the beginning of a word, move to the beginning of the previous word. If the
    489 cursor was positioned on the first character of the line, the terminal shall be alerted and the cursor shall not be moved. If the
    490 <i>count</i> is larger than the number of words preceding the cursor, this shall not be considered an error; the cursor shall
    491 return to the first character on the line.</dd>
    492 <dt><b>[</b><i>count</i><b>]B</b></dt>
    493 <dd>Move to the beginning of the current bigword. If at the beginning of a bigword, move to the beginning of the previous bigword.
    494 If the cursor was positioned on the first character of the line, the terminal shall be alerted and the cursor shall not be moved.
    495 If the <i>count</i> is larger than the number of bigwords preceding the cursor, this shall not be considered an error; the cursor
    496 shall return to the first character on the line.</dd>
    497 <dt><b>^</b></dt>
    498 <dd>Move the current cursor position to the first character on the input line that is not a &lt;blank&gt;.</dd>
    499 <dt><b>$</b></dt>
    500 <dd>Move to the last character position on the current command line.</dd>
    501 <dt><b>0</b></dt>
    502 <dd>(Zero.) Move to the first character position on the current command line.</dd>
    503 <dt><b>[</b><i>count</i><b>]|</b></dt>
    504 <dd>Move to the <i>count</i>th character position on the current command line. If no number is specified, move to the first
    505 position. The first character position shall be numbered 1. If the count is larger than the number of characters on the line, this
    506 shall not be considered an error; the cursor shall be placed on the last character on the line.</dd>
    507 <dt><b>[</b><i>count</i><b>]f</b><i>c</i></dt>
    508 <dd>Move to the first occurrence of the character <tt>'c'</tt> that occurs after the current cursor position. If the cursor was
    509 positioned on the last character of the line, the terminal shall be alerted and the cursor shall not be advanced. If the character
    510 <tt>'c'</tt> does not occur in the line after the current cursor position, the terminal shall be alerted and the cursor shall not
    511 be moved.</dd>
    512 <dt><b>[</b><i>count</i><b>]F</b><i>c</i></dt>
    513 <dd>Move to the first occurrence of the character <tt>'c'</tt> that occurs before the current cursor position. If the cursor was
    514 positioned on the first character of the line, the terminal shall be alerted and the cursor shall not be moved. If the character
    515 <tt>'c'</tt> does not occur in the line before the current cursor position, the terminal shall be alerted and the cursor shall not
    516 be moved.</dd>
    517 <dt><b>[</b><i>count</i><b>]t</b><i>c</i></dt>
    518 <dd>Move to the character before the first occurrence of the character <tt>'c'</tt> that occurs after the current cursor position.
    519 If the cursor was positioned on the last character of the line, the terminal shall be alerted and the cursor shall not be advanced.
    520 If the character <tt>'c'</tt> does not occur in the line after the current cursor position, the terminal shall be alerted and the
    521 cursor shall not be moved.</dd>
    522 <dt><b>[</b><i>count</i><b>]T</b><i>c</i></dt>
    523 <dd>Move to the character after the first occurrence of the character <tt>'c'</tt> that occurs before the current cursor position.
    524 If the cursor was positioned on the first character of the line, the terminal shall be alerted and the cursor shall not be moved.
    525 If the character <tt>'c'</tt> does not occur in the line before the current cursor position, the terminal shall be alerted and the
    526 cursor shall not be moved.</dd>
    527 <dt><b>[</b><i>count</i><b>];</b></dt>
    528 <dd>Repeat the most recent <b>f</b>, <b>F</b>, <b>t</b>, or <b>T</b> command. Any number argument on that previous command shall be
    529 ignored. Errors are those described for the repeated command.</dd>
    530 <dt><b>[</b><i>count</i><b>],</b></dt>
    531 <dd>Repeat the most recent <b>f</b>, <b>F</b>, <b>t</b>, or <b>T</b> command. Any number argument on that previous command shall be
    532 ignored. However, reverse the direction of that command.</dd>
    533 <dt><b>a</b></dt>
    534 <dd>Enter insert mode after the current cursor position. Characters that are entered shall be inserted before the next
    535 character.</dd>
    536 <dt><b>A</b></dt>
    537 <dd>Enter insert mode after the end of the current command line.</dd>
    538 <dt><b>i</b></dt>
    539 <dd>Enter insert mode at the current cursor position. Characters that are entered shall be inserted before the current
    540 character.</dd>
    541 <dt><b>I</b></dt>
    542 <dd>Enter insert mode at the beginning of the current command line.</dd>
    543 <dt><b>R</b></dt>
    544 <dd>Enter insert mode, replacing characters from the command line beginning at the current cursor position.</dd>
    545 <dt><b>[</b><i>count</i><b>]c</b><i>motion</i></dt>
    546 <dd><br>
    547 Delete the characters between the current cursor position and the cursor position that would result from the specified motion
    548 command. Then enter insert mode before the first character following any deleted characters. If <i>count</i> is specified, it shall
    549 be applied to the motion command. A <i>count</i> shall be ignored for the following motion commands:
    550 <pre>
    551 <tt>0    ^    $    c
    552 </tt></pre>
    553 <p>If the motion command is the character <tt>'c'</tt>, the current command line shall be cleared and insert mode shall be entered.
    554 If the motion command would move the current cursor position toward the beginning of the command line, the character under the
    555 current cursor position shall not be deleted. If the motion command would move the current cursor position toward the end of the
    556 command line, the character under the current cursor position shall be deleted. If the <i>count</i> is larger than the number of
    557 characters between the current cursor position and the end of the command line toward which the motion command would move the
    558 cursor, this shall not be considered an error; all of the remaining characters in the aforementioned range shall be deleted and
    559 insert mode shall be entered. If the motion command is invalid, the terminal shall be alerted, the cursor shall not be moved, and
    560 no text shall be deleted.</p>
    561 </dd>
    562 <dt><b>C</b></dt>
    563 <dd>Delete from the current character to the end of the line and enter insert mode at the new end-of-line.</dd>
    564 <dt><b>S</b></dt>
    565 <dd>Clear the entire edit line and enter insert mode.</dd>
    566 <dt><b>[</b><i>count</i><b>]r</b><i>c</i></dt>
    567 <dd>Replace the current character with the character <tt>'c'</tt>. With a number <i>count</i>, replace the current and the
    568 following <i>count</i>-1 characters. After this command, the current cursor position shall be on the last character that was
    569 changed. If the <i>count</i> is larger than the number of characters after the cursor, this shall not be considered an error; all
    570 of the remaining characters shall be changed.</dd>
    571 <dt><b>[</b><i>count</i><b>]_</b></dt>
    572 <dd>Append a &lt;space&gt; after the current character position and then append the last bigword in the previous input line after
    573 the &lt;space&gt;. Then enter insert mode after the last character just appended. With a number <i>count</i>, append the
    574 <i>count</i>th bigword in the previous line.</dd>
    575 <dt><b>[</b><i>count</i><b>]x</b></dt>
    576 <dd>Delete the character at the current cursor position and place the deleted characters in the save buffer. If the cursor was
    577 positioned on the last character of the line, the character shall be deleted and the cursor position shall be moved to the previous
    578 character (the new last character). If the <i>count</i> is larger than the number of characters after the cursor, this shall not be
    579 considered an error; all the characters from the cursor to the end of the line shall be deleted.</dd>
    580 <dt><b>[</b><i>count</i><b>]X</b></dt>
    581 <dd>Delete the character before the current cursor position and place the deleted characters in the save buffer. The character
    582 under the current cursor position shall not change. If the cursor was positioned on the first character of the line, the terminal
    583 shall be alerted, and the <b>X</b> command shall have no effect. If the line contained a single character, the <b>X</b> command
    584 shall have no effect. If the line contained no characters, the terminal shall be alerted and the cursor shall not be moved. If the
    585 <i>count</i> is larger than the number of characters before the cursor, this shall not be considered an error; all the characters
    586 from before the cursor to the beginning of the line shall be deleted.</dd>
    587 <dt><b>[</b><i>count</i><b>]d</b><i>motion</i></dt>
    588 <dd><br>
    589 Delete the characters between the current cursor position and the character position that would result from the motion command. A
    590 number <i>count</i> repeats the motion command <i>count</i> times. If the motion command would move toward the beginning of the
    591 command line, the character under the current cursor position shall not be deleted. If the motion command is <b>d</b>, the entire
    592 current command line shall be cleared. If the <i>count</i> is larger than the number of characters between the current cursor
    593 position and the end of the command line toward which the motion command would move the cursor, this shall not be considered an
    594 error; all of the remaining characters in the aforementioned range shall be deleted. The deleted characters shall be placed in the
    595 save buffer.</dd>
    596 <dt><b>D</b></dt>
    597 <dd>Delete all characters from the current cursor position to the end of the line. The deleted characters shall be placed in the
    598 save buffer.</dd>
    599 <dt><b>[</b><i>count</i><b>]y</b><i>motion</i></dt>
    600 <dd><br>
    601 Yank (that is, copy) the characters from the current cursor position to the position resulting from the motion command into the
    602 save buffer. A number <i>count</i> shall be applied to the motion command. If the motion command would move toward the beginning of
    603 the command line, the character under the current cursor position shall not be included in the set of yanked characters. If the
    604 motion command is <b>y</b>, the entire current command line shall be yanked into the save buffer. The current cursor position shall
    605 be unchanged. If the <i>count</i> is larger than the number of characters between the current cursor position and the end of the
    606 command line toward which the motion command would move the cursor, this shall not be considered an error; all of the remaining
    607 characters in the aforementioned range shall be yanked.</dd>
    608 <dt><b>Y</b></dt>
    609 <dd>Yank the characters from the current cursor position to the end of the line into the save buffer. The current character
    610 position shall be unchanged.</dd>
    611 <dt><b>[</b><i>count</i><b>]p</b></dt>
    612 <dd>Put a copy of the current contents of the save buffer after the current cursor position. The current cursor position shall be
    613 advanced to the last character put from the save buffer. A <i>count</i> shall indicate how many copies of the save buffer shall be
    614 put.</dd>
    615 <dt><b>[</b><i>count</i><b>]P</b></dt>
    616 <dd>Put a copy of the current contents of the save buffer before the current cursor position. The current cursor position shall be
    617 moved to the last character put from the save buffer. A <i>count</i> shall indicate how many copies of the save buffer shall be
    618 put.</dd>
    619 <dt><b>u</b></dt>
    620 <dd>Undo the last command that changed the edit line. This operation shall not undo the copy of any command line to the edit
    621 line.</dd>
    622 <dt><b>U</b></dt>
    623 <dd>Undo all changes made to the edit line. This operation shall not undo the copy of any command line to the edit line.</dd>
    624 <dt><b>[</b><i>count</i><b>]k</b></dt>
    625 <dd></dd>
    626 <dt><b>[</b><i>count</i><b>]-</b></dt>
    627 <dd>Set the current command line to be the <i>count</i>th previous command line in the shell command history. If <i>count</i> is
    628 not specified, it shall default to 1. The cursor shall be positioned on the first character of the new command. If a <b>k</b> or
    629 <b>-</b> command would retreat past the maximum number of commands in effect for this shell (affected by the <i>HISTSIZE</i>
    630 environment variable), the terminal shall be alerted, and the command shall have no effect.</dd>
    631 <dt><b>[</b><i>count</i><b>]j</b></dt>
    632 <dd></dd>
    633 <dt><b>[</b><i>count</i><b>]+</b></dt>
    634 <dd>Set the current command line to be the <i>count</i>th next command line in the shell command history. If <i>count</i> is not
    635 specified, it shall default to 1. The cursor shall be positioned on the first character of the new command. If a <b>j</b> or
    636 <b>+</b> command advances past the edit line, the current command line shall be restored to the edit line and the terminal shall be
    637 alerted.</dd>
    638 <dt><b>[</b><i>number</i><b>]G</b></dt>
    639 <dd>Set the current command line to be the oldest command line stored in the shell command history. With a number <i>number</i>,
    640 set the current command line to be the command line <i>number</i> in the history. If command line <i>number</i> does not exist, the
    641 terminal shall be alerted and the command line shall not be changed.</dd>
    642 <dt><b>/</b><i>pattern</i>&lt;newline&gt;</dt>
    643 <dd><br>
    644 Move backwards through the command history, searching for the specified pattern, beginning with the previous command line. Patterns
    645 use the pattern matching notation described in <a href="../utilities/V3_chap02.html#tag_19_14"><i>2.14 Pattern Matching
    646 Notation</i></a> , except that the <tt>'^'</tt> character shall have special meaning when it appears as the first character of
    647 <i>pattern</i>. In this case, the <tt>'^'</tt> is discarded and the characters after the <tt>'^'</tt> shall be matched only at the
    648 beginning of a line. Commands in the command history shall be treated as strings, not as filenames. If the pattern is not found,
    649 the current command line shall be unchanged and the terminal shall be alerted. If it is found in a previous line, the current
    650 command line shall be set to that line and the cursor shall be set to the first character of the new command line.
    651 <p>If <i>pattern</i> is empty, the last non-empty pattern provided to <b>/</b> or <b>?</b> shall be used. If there is no previous
    652 non-empty pattern, the terminal shall be alerted and the current command line shall remain unchanged.</p>
    653 </dd>
    654 <dt><b>?</b><i>pattern</i>&lt;newline&gt;</dt>
    655 <dd><br>
    656 Move forwards through the command history, searching for the specified pattern, beginning with the next command line. Patterns use
    657 the pattern matching notation described in <a href="../utilities/V3_chap02.html#tag_19_14"><i>2.14 Pattern Matching
    658 Notation</i></a> , except that the <tt>'^'</tt> character shall have special meaning when it appears as the first character of
    659 <i>pattern</i>. In this case, the <tt>'^'</tt> is discarded and the characters after the <tt>'^'</tt> shall be matched only at the
    660 beginning of a line. Commands in the command history shall be treated as strings, not as filenames. If the pattern is not found,
    661 the current command line shall be unchanged and the terminal shall be alerted. If it is found in a following line, the current
    662 command line shall be set to that line and the cursor shall be set to the fist character of the new command line.
    663 <p>If <i>pattern</i> is empty, the last non-empty pattern provided to <b>/</b> or <b>?</b> shall be used. If there is no previous
    664 non-empty pattern, the terminal shall be alerted and the current command line shall remain unchanged.</p>
    665 </dd>
    666 <dt><b>n</b></dt>
    667 <dd>Repeat the most recent <b>/</b> or <b>?</b> command. If there is no previous <b>/</b> or <b>?</b>, the terminal shall be
    668 alerted and the current command line shall remain unchanged.</dd>
    669 <dt><b>N</b></dt>
    670 <dd>Repeat the most recent <b>/</b> or <b>?</b> command, reversing the direction of the search. If there is no previous <b>/</b> or
    671 <b>?</b>, the terminal shall be alerted and the current command line shall remain unchanged.</dd>
    672 </dl>
    673 </blockquote>
    674 <h4 class="mansect"><a name="tag_20_110_14" id="tag_20_110_14"></a>EXIT STATUS</h4>
    675 <blockquote>
    676 <p>The following exit values shall be returned:</p>
    677 <dl compact>
    678 <dd></dd>
    679 <dt>&nbsp;&nbsp;&nbsp;&nbsp;0</dt>
    680 <dd>The script to be executed consisted solely of zero or more blank lines or comments, or both.</dd>
    681 <dt>1-125</dt>
    682 <dd>A non-interactive shell detected an error other than <i>command_file</i> not found, <i>command_file</i> not executable, or an
    683 unrecoverable read error while reading commands (except from the <i>file</i> operand of the <a href=
    684 "../utilities/dot.html"><i>dot</i></a> special built-in); including but not limited to syntax, redirection, or variable assignment
    685 errors.</dd>
    686 <dt>&nbsp;&nbsp;126</dt>
    687 <dd>A specified <i>command_file</i> could not be executed due to an [ENOEXEC] error (see <a href=
    688 "../utilities/V3_chap02.html#tag_19_09_01_04"><i>2.9.1.4 Command Search and Execution</i></a> , item 2).</dd>
    689 <dt>&nbsp;&nbsp;127</dt>
    690 <dd>A specified <i>command_file</i> could not be found by a non-interactive shell.</dd>
    691 <dt>&nbsp;&nbsp;128</dt>
    692 <dd>An unrecoverable read error was detected while reading commands, except from the <i>file</i> operand of the <a href=
    693 "../utilities/dot.html"><i>dot</i></a> special built-in.</dd>
    694 </dl>
    695 <p>Otherwise, the shell shall terminate in the same manner as for an <a href="../utilities/V3_chap02.html#exit"><i>exit</i></a>
    696 command with no operands, unless the last command the shell invoked was executed without forking, in which case the wait status
    697 seen by the parent process of the shell shall be the wait status of the last command the shell invoked. See the <a href=
    698 "../utilities/V3_chap02.html#exit"><i>exit</i></a> utility in <a href="../utilities/V3_chap02.html#tag_19_15"><i>2.15 Special
    699 Built-In Utilities</i></a> .</p>
    700 </blockquote>
    701 <h4 class="mansect"><a name="tag_20_110_15" id="tag_20_110_15"></a>CONSEQUENCES OF ERRORS</h4>
    702 <blockquote>
    703 <p>See <a href="../utilities/V3_chap02.html#tag_19_08_01"><i>2.8.1 Consequences of Shell Errors</i></a> .</p>
    704 </blockquote>
    705 <hr>
    706 <div class="box"><em>The following sections are informative.</em></div>
    707 <h4 class="mansect"><a name="tag_20_110_16" id="tag_20_110_16"></a>APPLICATION USAGE</h4>
    708 <blockquote>
    709 <p>Standard input and standard error are the files that determine whether a shell is interactive when <b>-i</b> is not specified.
    710 For example:</p>
    711 <pre>
    712 <tt>sh &gt; file
    713 </tt></pre>
    714 <p>and:</p>
    715 <pre>
    716 <tt>sh 2&gt; file
    717 </tt></pre>
    718 <p>create interactive and non-interactive shells, respectively. Although both accept terminal input, the results of error
    719 conditions are different, as described in <a href="../utilities/V3_chap02.html#tag_19_08_01"><i>2.8.1 Consequences of Shell
    720 Errors</i></a> ; in the second example a redirection error encountered by a special built-in utility aborts the shell.</p>
    721 <p><i>sh</i> <b>-n</b> can be used to check for many syntax errors without waiting for <i>complete_commands</i> to be executed, but
    722 may be fooled into declaring false positives or missing actual errors that would occur when the shell actually evaluates <a href=
    723 "../utilities/eval.html"><i>eval</i></a> commands present in the script, or if there are <a href=
    724 "../utilities/alias.html"><i>alias</i></a> (or <a href="../utilities/unalias.html"><i>unalias</i></a>) commands in the script that
    725 would alter the syntax of commands that use the affected aliases.</p>
    726 <p>A conforming application must protect its first operand, if it starts with a &lt;plus-sign&gt;, by preceding it with the
    727 <tt>"--"</tt> argument that denotes the end of the options.</p>
    728 <p>Applications should note that the standard <i>PATH</i> to the shell cannot be assumed to be either <b>/bin/sh</b> or
    729 <b>/usr/bin/sh</b>, and should be determined by interrogation of the <i>PATH</i> returned by <a href=
    730 "../utilities/getconf.html"><i>getconf</i></a> <i>PATH ,</i> ensuring that the returned pathname is an absolute pathname and not a
    731 shell built-in.</p>
    732 <p>For example, to determine the location of the standard <i>sh</i> utility:</p>
    733 <pre>
    734 <tt>command -v sh
    735 </tt></pre>
    736 <p>On some implementations this might return:</p>
    737 <pre>
    738 <tt>/usr/xpg4/bin/sh
    739 </tt></pre>
    740 <p>Furthermore, on systems that support executable scripts (the <tt>"#!"</tt> construct), it is recommended that applications using
    741 executable scripts install them using <a href="../utilities/getconf.html"><i>getconf</i></a> <i>PATH</i> to determine the shell
    742 pathname and update the <tt>"#!"</tt> script appropriately as it is being installed (for example, with <a href=
    743 "../utilities/sed.html"><i>sed</i></a>). For example:</p>
    744 <pre>
    745 <tt>#
    746 # Installation time script to install correct POSIX shell pathname
    747 #
    748 # Get list of paths to check
    749 #
    750 Sifs=$IFS
    751 Sifs_set=${IFS+y}
    752 IFS=:
    753 set -- $(getconf PATH)
    754 if [ "$Sifs_set" = y ]
    755 then
    756     IFS=$Sifs
    757 else
    758     unset IFS
    759 fi
    760 #
    761 # Check each path for 'sh'
    762 #
    763 for i
    764 do
    765     if [ -x "${i}"/sh ]
    766     then
    767         Pshell=${i}/sh
    768     fi
    769 done
    770 #
    771 # This is the list of scripts to update. They should be of the
    772 # form '${name}.source' and will be transformed to '${name}'.
    773 # Each script should begin:
    774 #
    775 # #!INSTALLSHELLPATH
    776 #
    777 scripts="a b c"
    778 #
    779 # Transform each script
    780 #
    781 for i in ${scripts}
    782 do
    783     sed -e "s|INSTALLSHELLPATH|${Pshell}|" &lt; ${i}.source &gt; ${i}
    784 done
    785 </tt></pre></blockquote>
    786 <h4 class="mansect"><a name="tag_20_110_17" id="tag_20_110_17"></a>EXAMPLES</h4>
    787 <blockquote>
    788 <ol>
    789 <li>
    790 <p>Execute a shell command from a string:</p>
    791 <pre>
    792 <tt>sh -c "cat myfile"
    793 </tt></pre></li>
    794 <li>
    795 <p>Execute a shell script from a file in the current directory:</p>
    796 <pre>
    797 <tt>sh my_shell_cmds
    798 </tt></pre></li>
    799 </ol>
    800 </blockquote>
    801 <h4 class="mansect"><a name="tag_20_110_18" id="tag_20_110_18"></a>RATIONALE</h4>
    802 <blockquote>
    803 <p>The <i>sh</i> utility and the <a href="../utilities/V3_chap02.html#set"><i>set</i></a> special built-in utility share a common
    804 set of options.</p>
    805 <p>The name <i>IFS</i> was originally an abbreviation of &quot;Input Field Separators&quot;; however, this name is misleading as the
    806 <i>IFS</i> characters are actually used as field terminators. One justification for ignoring the contents of <i>IFS</i> upon entry
    807 to the script, beyond security considerations, is to assist possible future shell compilers. Allowing <i>IFS</i> to be imported
    808 from the environment prevents many optimizations that might otherwise be performed via dataflow analysis of the script itself.</p>
    809 <p>The text in the STDIN section about non-blocking reads concerns an instance of <i>sh</i> that has been invoked, probably by a
    810 C-language program, with standard input that has been opened using the O_NONBLOCK flag; see <a href=
    811 "../functions/open.html"><i>open</i>()</a> in the System Interfaces volume of POSIX.1-2024. If the shell did not reset this flag,
    812 it would immediately terminate because no input data would be available yet and that would be considered the same as
    813 end-of-file.</p>
    814 <p>The options associated with a <i>restricted shell</i> (command name <i>rsh</i> and the <b>-r</b> option) were excluded because
    815 the standard developers considered that the implied level of security could not be achieved and they did not want to raise false
    816 expectations.</p>
    817 <p>On systems that support set-user-ID scripts, a historical trapdoor has been to link a script to the name <b>-i</b>. When it is
    818 called by a sequence such as:</p>
    819 <pre>
    820 <tt>sh -
    821 </tt></pre>
    822 <p>or by:</p>
    823 <pre>
    824 <tt>#! usr/bin/sh -
    825 </tt></pre>
    826 <p>the historical systems have assumed that no option letters follow. Thus, this volume of POSIX.1-2024 allows the single
    827 &lt;hyphen-minus&gt; to mark the end of the options, in addition to the use of the regular <tt>"--"</tt> argument, because it was
    828 considered that the older practice was so pervasive. An alternative approach is taken by the KornShell, where real and effective
    829 user/group IDs must match for an interactive shell; this behavior is specifically allowed by this volume of POSIX.1-2024.
    830 <basefont size="2"></p>
    831 <dl>
    832 <dt><b>Note:</b></dt>
    833 <dd>There are other problems with set-user-ID scripts that the two approaches described here do not resolve.</dd>
    834 </dl>
    835 <basefont size="3">
    836 <p>The initialization process for the history file can be dependent on the system start-up files, in that they may contain commands
    837 that effectively preempt the user's settings of <i>HISTFILE</i> and <i>HISTSIZE .</i> In some historical shells, the history file
    838 is initialized just after the <i>ENV</i> file has been processed. Therefore, it is implementation-defined whether changes made to
    839 <i>HISTFILE</i> after the history file has been initialized are effective.</p>
    840 <p>The default messages for the various <i>MAIL -related</i> messages are unspecified because they vary across implementations.
    841 Typical messages are:</p>
    842 <pre>
    843 <tt>"you have mail\n"
    844 </tt></pre>
    845 <p>or:</p>
    846 <pre>
    847 <tt>"you have new mail\n"
    848 </tt></pre>
    849 <p>It is important that the descriptions of command line editing refer to the same shell as that in POSIX.1-2024 so that
    850 interactive users can also be application programmers without having to deal with programmatic differences in their two
    851 environments. It is also essential that the utility name <i>sh</i> be specified because this explicit utility name is too firmly
    852 rooted in historical practice of application programs for it to change.</p>
    853 <p>Consideration was given to mandating a diagnostic message when attempting to set <a href=
    854 "../utilities/vi.html"><i>vi</i></a>-mode on terminals that do not support command line editing. However, it is not historical
    855 practice for the shell to be cognizant of all terminal types and thus be able to detect inappropriate terminals in all cases.
    856 Implementations are encouraged to supply diagnostics in this case whenever possible, rather than leaving the user in a state where
    857 editing commands work incorrectly.</p>
    858 <p>In early proposals, the KornShell-derived <i>emacs</i> mode of command line editing was included, even though the <i>emacs</i>
    859 editor itself was not. The community of <i>emacs</i> proponents was adamant that the full <i>emacs</i> editor not be standardized
    860 because they were concerned that an attempt to standardize this very powerful environment would encourage vendors to ship strictly
    861 conforming versions lacking the extensibility required by the community. The author of the original <i>emacs</i> program also
    862 expressed his desire to omit the program. Furthermore, there were a number of historical systems that did not include <i>emacs</i>,
    863 or included it without supporting it, but there were very few that did not include and support <a href=
    864 "../utilities/vi.html"><i>vi</i></a>. The shell <i>emacs</i> command line editing mode was finally omitted because it became
    865 apparent that the KornShell version and the editor being distributed with the GNU system had diverged in some respects. The author
    866 of <i>emacs</i> requested that the POSIX <i>emacs</i> mode either be deleted or have a significant number of unspecified
    867 conditions. Although the KornShell author agreed to consider changes to bring the shell into alignment, the standard developers
    868 decided to defer specification at that time. At the time, it was assumed that convergence on an acceptable definition would occur
    869 for a subsequent draft, but that has not happened, and there appears to be no impetus to do so. In any case, implementations are
    870 free to offer additional command line editing modes based on the exact models of editors their users are most comfortable with.</p>
    871 <p>Early proposals had the following list entry in <a href="#tag_20_110_13_04">vi Line Editing Insert Mode</a> :</p>
    872 <dl compact>
    873 <dd></dd>
    874 <dt><tt>\</tt></dt>
    875 <dd>If followed by the <i>erase</i> or <i>kill</i> character, that character shall be inserted into the input line. Otherwise, the
    876 &lt;backslash&gt; itself shall be inserted into the input line.</dd>
    877 </dl>
    878 <p>However, this is not actually a feature of <i>sh</i> command line editing insert mode, but one of some historical terminal line
    879 drivers. Some conforming implementations continue to do this when the <a href="../utilities/stty.html"><i>stty</i></a>
    880 <b>iexten</b> flag is set.</p>
    881 <p>In interactive shells, SIGTERM is ignored so that <tt>kill 0</tt> does not kill the shell, and SIGINT is caught so that <a href=
    882 "../utilities/wait.html"><i>wait</i></a> is interruptible. If the shell does not ignore SIGTTIN, SIGTTOU, and SIGTSTP signals when
    883 it is interactive and the <b>-m</b> option is not in effect, these signals suspend the shell if it is not a session leader. If it
    884 is a session leader, the signals are discarded if they would stop the process, as required by XSH <a href=
    885 "../functions/V2_chap02.html#tag_16_04_03"><i>2.4.3 Signal Actions</i></a> for orphaned process groups.</p>
    886 <p>Earlier versions of this standard required that input files to the shell be text files except that line lengths were unlimited.
    887 However, that was overly restrictive in relation to the fact that shells can parse a script without a trailing newline, and in
    888 relation to a common practice of concatenating a shell script ending with an <tt>exit</tt> or <tt>exec $command</tt> with a binary
    889 data payload to form a single-file self-extracting archive.</p>
    890 </blockquote>
    891 <h4 class="mansect"><a name="tag_20_110_19" id="tag_20_110_19"></a>FUTURE DIRECTIONS</h4>
    892 <blockquote>
    893 <p>If this utility is directed to create a new directory entry that contains any bytes that have the encoded value of a
    894 &lt;newline&gt; character, implementations are encouraged to treat this as an error. A future version of this standard may require
    895 implementations to treat this as an error.</p>
    896 </blockquote>
    897 <h4 class="mansect"><a name="tag_20_110_20" id="tag_20_110_20"></a>SEE ALSO</h4>
    898 <blockquote>
    899 <p><a href="../utilities/V3_chap02.html#tag_19_09_01_04"><i>2.9.1.4 Command Search and Execution</i></a> , <a href=
    900 "../utilities/V3_chap02.html#tag_19"><i>2. Shell Command Language</i></a> , <a href="../utilities/cd.html#"><i>cd</i></a> ,
    901 <a href="../utilities/echo.html#"><i>echo</i></a> , <a href="../utilities/V3_chap02.html#tag_19_22"><i>exit</i></a> , <a href=
    902 "../utilities/fc.html#"><i>fc</i></a> , <a href="../utilities/pwd.html#"><i>pwd</i></a> , <a href=
    903 "../utilities/read.html#tag_20_100"><i>read</i></a> , <a href="../utilities/V3_chap02.html#tag_19_26"><i>set</i></a> , <a href=
    904 "../utilities/stty.html#"><i>stty</i></a> , <a href="../utilities/test.html#"><i>test</i></a> , <a href=
    905 "../utilities/V3_chap02.html#tag_19_29"><i>trap</i></a> , <a href="../utilities/umask.html#tag_20_132"><i>umask</i></a> , <a href=
    906 "../utilities/vi.html#"><i>vi</i></a></p>
    907 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    908 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    909 <p>XSH <a href="../functions/dup.html#"><i>dup</i></a> , <a href="../functions/exec.html#tag_17_129"><i>exec</i></a> , <a href=
    910 "../functions/exit.html#tag_17_130"><i>exit</i></a> , <a href="../functions/fork.html#"><i>fork</i></a> , <a href=
    911 "../functions/getrlimit.html#"><i>getrlimit</i></a> , <a href="../functions/open.html#"><i>open</i></a> , <a href=
    912 "../functions/pipe.html#"><i>pipe</i></a> , <a href="../functions/signal.html#"><i>signal</i></a> , <a href=
    913 "../functions/system.html#"><i>system</i></a> , <a href="../functions/umask.html#tag_17_645"><i>umask</i></a> , <a href=
    914 "../functions/wait.html#tag_17_658"><i>wait</i></a></p>
    915 </blockquote>
    916 <h4 class="mansect"><a name="tag_20_110_21" id="tag_20_110_21"></a>CHANGE HISTORY</h4>
    917 <blockquote>
    918 <p>First released in Issue 2.</p>
    919 </blockquote>
    920 <h4 class="mansect"><a name="tag_20_110_22" id="tag_20_110_22"></a>Issue 5</h4>
    921 <blockquote>
    922 <p>The FUTURE DIRECTIONS section is added.</p>
    923 <p>Text is added to the DESCRIPTION for the Large File Summit proposal.</p>
    924 </blockquote>
    925 <h4 class="mansect"><a name="tag_20_110_23" id="tag_20_110_23"></a>Issue 6</h4>
    926 <blockquote>
    927 <p>The Open Group Corrigendum U029/2 is applied, correcting the second SYNOPSIS.</p>
    928 <p>The Open Group Corrigendum U027/3 is applied, correcting a typographical error.</p>
    929 <p>The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:</p>
    930 <ul>
    931 <li>
    932 <p>The option letters derived from the <a href="../utilities/V3_chap02.html#set"><i>set</i></a> special built-in are also accepted
    933 with a leading &lt;plus-sign&gt; (<tt>'+'</tt>).</p>
    934 </li>
    935 <li>
    936 <p>Large file extensions are added:</p>
    937 <ul>
    938 <li>
    939 <p>Pathname expansion does not fail due to the size of a file.</p>
    940 </li>
    941 <li>
    942 <p>Shell input and output redirections have an implementation-defined offset maximum that is established in the open file
    943 description.</p>
    944 </li>
    945 </ul>
    946 </li>
    947 </ul>
    948 <p>In the ENVIRONMENT VARIABLES section, the text &quot;user's home directory&quot; is updated to &quot;directory referred to by the
    949 <i>HOME</i> environment variable&quot;.</p>
    950 <p>Descriptions for the <i>ENV</i> and <i>PWD</i> environment variables are included to align with the IEEE&nbsp;P1003.2b draft
    951 standard.</p>
    952 <p>The normative text is reworded to avoid use of the term &quot;must&quot; for application requirements.</p>
    953 </blockquote>
    954 <h4 class="mansect"><a name="tag_20_110_24" id="tag_20_110_24"></a>Issue 7</h4>
    955 <blockquote>
    956 <p>Austin Group Interpretation 1003.1-2001 #098 is applied, changing the definition of <i>IFS .</i></p>
    957 <p>SD5-XCU-ERN-97 is applied, updating the SYNOPSIS.</p>
    958 <p>Changes to the <a href="../utilities/pwd.html"><i>pwd</i></a> utility and <i>PWD</i> environment variable have been made to
    959 match the changes to the <a href="../functions/getcwd.html"><i>getcwd</i>()</a> function made for Austin Group Interpretation
    960 1003.1-2001 #140.</p>
    961 <p>Minor editorial changes are made to the User Portability Utilities option shading. No normative changes are implied.</p>
    962 <p>Minor changes are made to the install script example in the APPLICATION USAGE section.</p>
    963 <p>POSIX.1-2008, Technical Corrigendum 1, XCU/TC1-2008/0137 [152], XCU/TC1-2008/0138 [347], XCU/TC1-2008/0139 [347],
    964 XCU/TC1-2008/0140 [347], XCU/TC1-2008/0141 [299], and XCU/TC1-2008/0142 [347] are applied.</p>
    965 <p>POSIX.1-2008, Technical Corrigendum 2, XCU/TC2-2008/0175 [584], XCU/TC2-2008/0176 [584], XCU/TC2-2008/0177 [718],
    966 XCU/TC2-2008/0178 [884], XCU/TC2-2008/0179 [809], XCU/TC2-2008/0180 [884], and XCU/TC2-2008/0181 [584] are applied.</p>
    967 </blockquote>
    968 <h4 class="mansect"><a name="tag_20_110_25" id="tag_20_110_25"></a>Issue 8</h4>
    969 <blockquote>
    970 <p>Austin Group Defect 51 is applied, changing the EXIT STATUS section.</p>
    971 <p>Austin Group Defect 251 is applied, encouraging implementations to disallow the creation of filenames containing any bytes that
    972 have the encoded value of a &lt;newline&gt; character.</p>
    973 <p>Austin Group Defect 981 is applied, removing a reference to the <a href="../utilities/V3_chap02.html#set"><i>set</i></a>
    974 <b>-o</b> <i>nolog</i> option from the RATIONALE section.</p>
    975 <p>Austin Group Defect 1006 is applied, changing the description of the <i>ENV</i> environment variable.</p>
    976 <p>Austin Group Defect 1055 is applied, adding a paragraph about the <b>-n</b> option to the APPLICATION USAGE section.</p>
    977 <p>Austin Group Defect 1063 is applied, adding OB shading to the <b>-h</b> option and adding it to the list of options that are
    978 described as part of the <a href="../utilities/V3_chap02.html#set"><i>set</i></a> utility.</p>
    979 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    980 <p>Austin Group Defect 1250 is applied, changing the INPUT FILES section.</p>
    981 <p>Austin Group Defect 1266 is applied, clarifying the circumstances under which the shell is considered to be interactive.</p>
    982 <p>Austin Group Defect 1267 is applied, changing the ENVIRONMENT VARIABLES section to remove the UP shading from <i>HOME</i> and
    983 add it to <i>HISTSIZE .</i></p>
    984 <p>Austin Group Defect 1519 is applied, making the behavior explicitly unspecified if the <b>-o</b> or <b>+o</b> option is
    985 specified without an option-argument.</p>
    986 <p>Austin Group Defect 1629 is applied, changing the EXIT STATUS section.</p>
    987 </blockquote>
    988 <div class="box"><em>End of informative text.</em></div>
    989 <hr>
    990 <p>&nbsp;</p>
    991 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    992 <hr size="2" noshade>
    993 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    994 POSIX™ is a Trademark of The IEEE.<br>
    995 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    996 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    997 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    998 ]</font></center>
    999 <hr size="2" noshade>
   1000 <div class="NAVHEADER">
   1001 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
   1002 <tr class="nav">
   1003 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/sed.html" accesskey="P">&lt;&lt;&lt;
   1004 Previous</a></td>
   1005 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
   1006 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/sleep.html" accesskey="N">Next
   1007 &gt;&gt;&gt;</a></td>
   1008 </tr>
   1009 </table>
   1010 <hr align="left" width="100%"></div>
   1011 </body>
   1012 </html>