📄 sh.html
字号:
treating <i>IFS</i> as if it were not set.</dd><dt><i>LANG</i></dt><dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> forthe precedence of internationalization variables used to determine the values of locale categories.)</dd><dt><i>LC_ALL</i></dt><dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd><dt><i>LC_COLLATE</i></dt><dd><br>Determine the behavior of range expressions, equivalence classes, and multi-character collating elements within patternmatching.</dd><dt><i>LC_CTYPE</i></dt><dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte asopposed to multi-byte characters in arguments and input files), which characters are defined as letters (character class<b>alpha</b>), and the behavior of character classes within pattern matching.</dd><dt><i>LC_MESSAGES</i></dt><dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standarderror.</dd><dt><i>MAIL</i></dt><dd>Determine a pathname of the user's mailbox file for purposes of incoming mail notification. If this variable is set, the shellshall inform the user if the file named by the variable is created or if its modification time has changed. Informing the usershall be accomplished by writing a string of unspecified format to standard error prior to the writing of the next primary promptstring. Such check shall be performed only after the completion of the interval defined by the <i>MAILCHECK</i> variable after thelast such check. The user shall be informed only if <i>MAIL</i> is set and <i>MAILPATH</i> is not set. This volume ofIEEE Std 1003.1-2001 specifies the effects of this variable only for systems supporting the User Portability Utilitiesoption.</dd><dt><i>MAILCHECK</i></dt><dd><br>Establish a decimal integer value that specifies how often (in seconds) the shell shall check for the arrival of mail in the filesspecified by the <i>MAILPATH</i> or <i>MAIL</i> variables. The default value shall be 600 seconds. If set to zero, the shell shallcheck before issuing each primary prompt. This volume of IEEE Std 1003.1-2001 specifies the effects of this variable onlyfor systems supporting the User Portability Utilities option.</dd><dt><i>MAILPATH</i></dt><dd>Provide a list of pathnames and optional messages separated by colons. If this variable is set, the shell shall inform the userif any of the files named by the variable are created or if any of their modification times change. (See the preceding entry for<i>MAIL</i> for descriptions of mail arrival and user informing.) Each pathname can be followed by <tt>'%'</tt> and a string thatshall be subjected to parameter expansion and written to standard error when the modification time changes. If a <tt>'%'</tt>character in the pathname is preceded by a backslash, it shall be treated as a literal <tt>'%'</tt> in the pathname. The defaultmessage is unspecified. <p>The <i>MAILPATH</i> environment variable takes precedence over the <i>MAIL</i> variable. This volume ofIEEE Std 1003.1-2001 specifies the effects of this variable only for systems supporting the User Portability Utilitiesoption.</p></dd><dt><i>NLSPATH</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><i>PATH</i></dt><dd>Establish a string formatted as described in the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html">Chapter 8, Environment Variables</a>, used to effect command interpretation; see <a href="xcu_chap02.html#tag_02_09_01_01"><i>Command Search and Execution</i></a> .</dd><dt><i>PWD</i></dt><dd>This variable shall represent an absolute pathname of the current working directory. Assignments to this variable may beignored unless the value is an absolute pathname of the current working directory and there are no filename components of dot ordot-dot.</dd></dl></blockquote><h4><a name="tag_04_128_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>Default.</p></blockquote><h4><a name="tag_04_128_10"></a>STDOUT</h4><blockquote><p>See the STDERR section.</p></blockquote><h4><a name="tag_04_128_11"></a>STDERR</h4><blockquote><p>Except as otherwise stated (by the descriptions of any invoked utilities or in interactive mode), standard error shall be usedonly for diagnostic messages.</p></blockquote><h4><a name="tag_04_128_12"></a>OUTPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_128_13"></a>EXTENDED DESCRIPTION</h4><blockquote><p>See <a href="xcu_chap02.html#tag_02"><i>Shell Command Language</i></a> . The following additional capabilities are supported onsystems supporting the User Portability Utilities option.</p><h5><a name="tag_04_128_13_01"></a>Command History List</h5><p>When the <i>sh</i> utility is being used interactively, it shall maintain a list of commands previously entered from theterminal in the file named by the <i>HISTFILE</i> environment variable. The type, size, and internal format of this file areunspecified. Multiple <i>sh</i> processes can share access to the file for a user, if file access permissions allow this; see thedescription of the <i>HISTFILE</i> environment variable.</p><h5><a name="tag_04_128_13_02"></a>Command Line Editing</h5><p>When <i>sh</i> is being used interactively from a terminal, the current command and the command history (see <a href="fc.html"><i>fc</i></a> ) can be edited using <a href="../utilities/vi.html"><i>vi</i></a>-mode command line editing. This modeuses commands, described below, similar to a subset of those described in the <a href="../utilities/vi.html"><i>vi</i></a> utility.Implementations may offer other command line editing modes corresponding to other editing utilities.</p><p>The command <a href="../utilities/set.html"><i>set</i></a> <b>-o</b> <a href="../utilities/vi.html"><i>vi</i></a>shall enable <a href="../utilities/vi.html"><i>vi</i></a>-mode editing and place <i>sh</i> into <a href="../utilities/vi.html"><i>vi</i></a> insert mode (see <a href="#tag_04_128_13_03">Command Line Editing (vi-mode)</a> ). Thiscommand also shall disable any other editing mode that the implementation may provide. The command <a href="../utilities/set.html"><i>set</i></a> <b>+o</b> <a href="../utilities/vi.html"><i>vi</i></a> disables <a href="../utilities/vi.html"><i>vi</i></a>-mode editing.</p><p>Certain block-mode terminals may be unable to support shell command line editing. If a terminal is unable to provide either editmode, it need not be possible to <a href="../utilities/set.html"><i>set</i></a> <b>-o</b> <a href="../utilities/vi.html"><i>vi</i></a> when using the shell on this terminal.</p><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 bythe <a href="../utilities/stty.html"><i>stty</i></a> utility.</p><h5><a name="tag_04_128_13_03"></a>Command Line Editing (vi-mode)</h5><p>In <a href="../utilities/vi.html"><i>vi</i></a> editing mode, there shall be a distinguished line, the edit line. All theediting operations which modify a line affect the edit line. The edit line is always the newest line in the command historybuffer.</p><p>With <a href="../utilities/vi.html"><i>vi</i></a>-mode enabled, <i>sh</i> can be switched between insert mode and commandmode.</p><p>When in insert mode, an entered character shall be inserted into the command line, except as noted in <a href="#tag_04_128_13_04">vi Line Editing Insert Mode</a> . Upon entering <i>sh</i> and after termination of the previous command,<i>sh</i> shall be in insert mode.</p><p>Typing an escape character shall switch <i>sh</i> into command mode (see <a href="#tag_04_128_13_05">vi Line Editing CommandMode</a> ). In command mode, an entered character shall either invoke a defined operation, be used as part of a multi-characteroperation, or be treated as an error. A character that is not recognized as part of an editing command shall terminate any specificediting command and shall alert the terminal. Typing the <i>interrupt</i> character in command mode shall cause <i>sh</i> toterminate command line editing on the current command line, reissue the prompt on the next line of the terminal, and reset thecommand history (see <a href="fc.html"><i>fc</i></a> ) so that the most recently executed command is the previous command (that is,the command that was being edited when it was interrupted is not reentered into the history).</p><p>In the following sections, the phrase "move the cursor to the beginning of the word" shall mean "move the cursor to the firstcharacter of the current word" and the phrase "move the cursor to the end of the word" shall mean "move the cursor to the lastcharacter of the current word". The phrase "beginning of the command line" indicates the point between the end of the promptstring issued by the shell (or the beginning of the terminal line, if there is no prompt string) and the first character of thecommand text.</p><h5><a name="tag_04_128_13_04"></a>vi Line Editing Insert Mode</h5><p>While in insert mode, any character typed shall be inserted in the current command line, unless it is from the followingset.</p><dl compact><dt><newline></dt><dd>Execute the current command line. If the current command line is not empty, this line shall be entered into the command history(see <a href="fc.html"><i>fc</i></a> ).</dd><dt><i>erase</i></dt><dd>Delete the character previous to the current cursor position and move the current cursor position back one character. In insertmode, characters shall be erased from both the screen and the buffer when backspacing.</dd><dt><i>interrupt</i></dt><dd>Terminate command line editing with the same effects as described for interrupting command mode; see <a href="#tag_04_128_13_03">Command Line Editing (vi-mode)</a> .</dd><dt><i>kill</i></dt><dd>Clear all the characters from the input line.</dd><dt><control>-V</dt><dd>Insert the next character input, even if the character is otherwise a special insert mode character.</dd><dt><control>-W</dt><dd>Delete the characters from the one preceding the cursor to the preceding word boundary. The word boundary in this case is thecloser 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>character classification of the current locale.</dd><dt><i>end-of-file</i></dt><dd>Interpreted as the end of input in <i>sh</i>. This interpretation shall occur only at the beginning of an input line. If<i>end-of-file</i> is entered other than at the beginning of the line, the results are unspecified.</dd><dt><ESC></dt><dd>Place <i>sh</i> into command mode.</dd></dl><h5><a name="tag_04_128_13_05"></a>vi Line Editing Command Mode</h5><p>In command mode for the command line editing feature, decimal digits not beginning with 0 that precede a command letter shall beremembered. Some commands use these decimal digits as a count number that affects the operation.</p><p>The term <i>motion command</i> represents one of the commands:</p><pre><tt><space> 0 b F l W ^ $ ; E f T w | , B e h t</tt></pre><p>If the current line is not the edit line, any command that modifies the current line shall cause the content of the current lineto replace the content of the edit line, and the current line shall become the edit line. This replacement cannot be undone (seethe <b>u</b> and <b>U</b> commands below). The modification requested shall then be performed to the edit line. When the currentline is the edit line, the modification shall be done directly to the edit line.</p><p>Any command that is preceded by <i>count</i> shall take a count (the numeric value of any preceding decimal digits). Unlessotherwise noted, this count shall cause the specified operation to repeat by the number of times specified by the count. Alsounless otherwise noted, a <i>count</i> that is out of range is considered an error condition and shall alert the terminal, butneither the cursor position, nor the command line, shall change.</p><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.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><p>The following commands shall be recognized in command mode:</p><dl compact><dt><newline></dt><dd>Execute the current command line. If the current command line is not empty, this line shall be entered into the command history(see <a href="fc.html"><i>fc</i></a> ).</dd><dt><control>-L</dt>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -