⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<p class="tent"><b>ma</b></p></td><td align="left"><p class="tent"><b>mark</b></p></td><td align="left"><p class="tent">s</p></td><td align="left"><p class="tent"><b>s</b></p></td><td align="left"><p class="tent"><b>&nbsp;</b></p></td><td align="left"><p class="tent">&nbsp;</p></td><td align="left"><p class="tent"><b>&nbsp;</b></p></td><td align="left"><p class="tent"><b>&nbsp;</b></p></td></tr></table></center><p>Implementation extensions with names causing similar ambiguities shall not be checked for a match until all possible matches forcommands specified by IEEE&nbsp;Std&nbsp;1003.1-2001 have been checked.</p></li><li><p>If the command is a <b>!</b> command, or if the command is a <b>read</b> command followed by zero or more &lt;blank&gt;s and a<b>!</b>, or if the command is a <b>write</b> command followed by one or more &lt;blank&gt;s and a <b>!</b>, the rest of thecommand shall include all characters up to a non-backslash-escaped &lt;newline&gt;. The &lt;newline&gt; shall be discarded and anysubsequent characters shall be parsed as a separate <i>ex</i> command.</p></li><li><p>Otherwise, if the command is an <b>edit</b>, <b>ex</b>, or <b>next</b> command, or a <b>visual</b> command while in open orvisual mode, the next part of the command shall be parsed as follows:</p><ol type="a"><li><p>Any <tt>'!'</tt> character immediately following the command shall be skipped and be part of the command.</p></li><li><p>Any leading &lt;blank&gt;s shall be skipped and be part of the command.</p></li><li><p>If the next character is a <tt>'+'</tt> , characters up to the first non-backslash-escaped &lt;newline&gt; ornon-backslash-escaped &lt;blank&gt; shall be skipped and be part of the command.</p></li><li><p>The rest of the command shall be determined by the steps specified in paragraph 12.</p></li></ol></li><li><p>Otherwise, if the command is a <b>global</b>, <b>open</b>, <b>s</b>, or <b>v</b> command, the next part of the command shall beparsed as follows:</p><ol type="a"><li><p>Any leading &lt;blank&gt;s shall be skipped and be part of the command.</p></li><li><p>If the next character is not an alphanumeric, double-quote, &lt;newline&gt;, backslash, or vertical-line character:</p><ol><li><p>The next character shall be used as a command delimiter.</p></li><li><p>If the command is a <b>global</b>, <b>open</b>, or <b>v</b> command, characters up to the first non-backslash-escaped&lt;newline&gt;, or first non-backslash-escaped delimiter character, shall be skipped and be part of the command.</p></li><li><p>If the command is an <b>s</b> command, characters up to the first non-backslash-escaped &lt;newline&gt;, or secondnon-backslash-escaped delimiter character, shall be skipped and be part of the command.</p></li></ol></li><li><p>If the command is a <b>global</b> or <b>v</b> command, characters up to the first non-backslash-escaped &lt;newline&gt; shall beskipped and be part of the command.</p></li><li><p>Otherwise, the rest of the command shall be determined by the steps specified in paragraph 12.</p></li></ol></li><li><p>Otherwise:</p><ol type="a"><li><p>If the command was a <b>map</b>, <b>unmap</b>, <b>abbreviate</b>, or <b>unabbreviate</b> command, characters up to the firstnon- &lt;control&gt;-V-escaped &lt;newline&gt;, vertical-line, or double-quote character shall be skipped and be part of thecommand.</p></li><li><p>Otherwise, characters up to the first non-backslash-escaped &lt;newline&gt;, vertical-line, or double-quote character shall beskipped and be part of the command.</p></li><li><p>If the command was an <b>append</b>, <b>change</b>, or <b>insert</b> command, and the step 12.b. ended at a vertical-linecharacter, any subsequent characters, up to the next non-backslash-escaped &lt;newline&gt; shall be used as input text to thecommand.</p></li><li><p>If the command was ended by a double-quote character, all subsequent characters, up to the next non-backslash-escaped&lt;newline&gt;, shall be discarded.</p></li><li><p>The terminating &lt;newline&gt; or vertical-line character shall be discarded and any subsequent characters shall be parsed as aseparate <i>ex</i> command.</p></li></ol></li></ol><p>Command arguments shall be parsed as described by the Synopsis and Description of each individual <i>ex</i> command. Thisparsing shall not be &lt;blank&gt;-sensitive, except for the <b>!</b> argument, which must follow the command name withoutintervening &lt;blank&gt;s, and where it would otherwise be ambiguous. For example, <i>count</i> and <i>flag</i> arguments need notbe &lt;blank&gt;-separated because <tt>"d22p"</tt> is not ambiguous, but <i>file</i> arguments to the <i>ex</i> <b>next</b> commandmust be separated by one or more &lt;blank&gt;s. Any &lt;blank&gt; in command arguments for the <b>abbreviate</b>,<b>unabbreviate</b>, <b>map</b>, and <b>unmap</b> commands can be &lt;control&gt;-V-escaped, in which case the &lt;blank&gt; shallnot be used as an argument delimiter. Any &lt;blank&gt; in the command argument for any other command can be backslash-escaped, inwhich case that &lt;blank&gt; shall not be used as an argument delimiter.</p><p>Within command arguments for the <b>abbreviate</b>, <b>unabbreviate</b>, <b>map</b>, and <b>unmap</b> commands, any charactercan be &lt;control&gt;-V-escaped. All such escaped characters shall be treated literally and shall have no special meaning. Withincommand arguments for all other <i>ex</i> commands that are not regular expressions or replacement strings, any character thatwould otherwise have a special meaning can be backslash-escaped. Escaped characters shall be treated literally, without specialmeaning as shell expansion characters or <tt>'!'</tt> , <tt>'%'</tt> , and <tt>'#'</tt> expansion characters. See <a href="#tag_04_45_13_58">Regular Expressions in ex</a> and <a href="#tag_04_45_13_59">Replacement Strings in ex</a> for descriptions ofcommand arguments that are regular expressions or replacement strings.</p><p>Non-backslash-escaped <tt>'%'</tt> characters appearing in <i>file</i> arguments to any <i>ex</i> command shall be replaced bythe current pathname; unescaped <tt>'#'</tt> characters shall be replaced by the alternate pathname. It shall be an error if<tt>'%'</tt> or <tt>'#'</tt> characters appear unescaped in an argument and their corresponding values are not set.</p><p>Non-backslash-escaped <tt>'!'</tt> characters in the arguments to either the <i>ex</i> <b>!</b> command or the open and visualmode <b>!</b> command, or in the arguments to the <i>ex</i> <b>read</b> command, where the first non- &lt;blank&gt; after thecommand name is a <tt>'!'</tt> character, or in the arguments to the <i>ex</i> <b>write</b> command where the command name isfollowed by one or more &lt;blank&gt;s and the first non- &lt;blank&gt; after the command name is a <tt>'!'</tt> character, shallbe replaced with the arguments to the last of those three commands as they appeared after all unescaped <tt>'%'</tt> , <tt>'#'</tt>, and <tt>'!'</tt> characters were replaced. It shall be an error if <tt>'!'</tt> characters appear unescaped in one of thesecommands and there has been no previous execution of one of these commands.</p><p>If an error occurs during the parsing or execution of an <i>ex</i> command:</p><ul><li><p>An informational message to this effect shall be written. Execution of the <i>ex</i> command shall stop, and the cursor (forexample, the current line and column) shall not be further modified.</p></li><li><p>If the <i>ex</i> command resulted from a map expansion, all characters from that map expansion shall be discarded, except asotherwise specified by the <b>map</b> command.</p></li><li><p>Otherwise, if the <i>ex</i> command resulted from the processing of an <i>EXINIT</i> environment variable, a <b>.exrc</b> file,a <b>:source</b> command, a <b>-c</b> option, or a <b>+</b> <i>command</i> specified to an <i>ex</i> <b>edit</b>, <b>ex</b>,<b>next</b>, or <b>visual</b> command, no further commands from the source of the commands shall be executed.</p></li><li><p>Otherwise, if the <i>ex</i> command resulted from the execution of a buffer or a <b>global</b> or <b>v</b> command, no furthercommands caused by the execution of the buffer or the <b>global</b> or <b>v</b> command shall be executed.</p></li><li><p>Otherwise, if the <i>ex</i> command was not terminated by a &lt;newline&gt;, all characters up to and including the nextnon-backslash-escaped &lt;newline&gt; shall be discarded.</p></li></ul><h5><a name="tag_04_45_13_04"></a>Input Editing in ex</h5><p>The following symbol is used in this and the following sections to specify command actions:</p><dl compact><dt><i>word</i></dt><dd>In the POSIX locale, a word consists of a maximal sequence of letters, digits, and underscores, delimited at both ends bycharacters other than letters, digits, or underscores, or by the beginning or end of a line or the edit buffer.</dd></dl><p>When accepting input characters from the user, in either <i>ex</i> command mode or <i>ex</i> text input mode, <i>ex</i> shallenable canonical mode input processing, as defined in the System Interfaces volume of IEEE&nbsp;Std&nbsp;1003.1-2001.</p><p>If in <i>ex</i> text input mode:</p><ol><li><p>If the <b>number</b> edit option is set, <i>ex</i> shall prompt for input using the line number that would be assigned to theline if it is entered, in the format specified for the <i>ex</i> <b>number</b> command.</p></li><li><p>If the <b>autoindent</b> edit option is set, <i>ex</i> shall prompt for input using <b>autoindent</b> characters, as describedby the <b>autoindent</b> edit option. <b>autoindent</b> characters shall follow the line number, if any.</p></li></ol><p>If in <i>ex</i> command mode:</p><ol><li><p>If the <b>prompt</b> edit option is set, input shall be prompted for using a single <tt>':'</tt> character; otherwise, thereshall be no prompt.</p></li></ol><p>The input characters in the following sections shall have the following effects on the input line.</p><h5><a name="tag_04_45_13_05"></a>Scroll</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>eof</tt></pre></dd></dl><p>See the description of the <a href="../utilities/stty.html"><i>stty</i></a> <i>eof</i> character in <a href="stty.html"><i>stty</i></a> .</p><p>If in <i>ex</i> command mode:</p><blockquote>If the <i>eof</i> character is the first character entered on the line, the line shall be evaluated as if it containedtwo characters: a &lt;control&gt;-D and a &lt;newline&gt;. <p>Otherwise, the <i>eof</i> character shall have no special meaning.</p></blockquote><br><p>If in <i>ex</i> text input mode:</p><blockquote>If the cursor follows an <b>autoindent</b> character, the <b>autoindent</b> characters in the line shall be modified sothat a part of the next text input character will be displayed on the first column in the line after the previous <b>shiftwidth</b>edit option column boundary, and the user shall be prompted again for input for the same line. <p>Otherwise, if the cursor follows a <tt>'0'</tt> , which follows an <b>autoindent</b> character, and the <tt>'0'</tt> was theprevious text input character, the <tt>'0'</tt> and all <b>autoindent</b> characters in the line shall be discarded, and the usershall be prompted again for input for the same line.</p><p>Otherwise, if the cursor follows a <tt>'^'</tt> , which follows an <b>autoindent</b> character, and the <tt>'^'</tt> was theprevious text input character, the <tt>'^'</tt> and all <b>autoindent</b> characters in the line shall be discarded, and the usershall be prompted again for input for the same line. In addition, the <b>autoindent</b> level for the next input line shall bederived from the same line from which the <b>autoindent</b> level for the current input line was derived.</p><p>Otherwise, if there are no <b>autoindent</b> or text input characters in the line, the <i>eof</i> character shall bediscarded.</p><p>Otherwise, the <i>eof</i> character shall have no special meaning.</p></blockquote><h5><a name="tag_04_45_13_06"></a>&lt;newline&gt;</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>&lt;newline&gt;<br>&lt;control&gt;-J</tt></pre></dd></dl><p>If in <i>ex</i> command mode:</p><blockquote>Cause the command line to be parsed; &lt;control&gt;-J shall be mapped to the &lt;newline&gt; for thispurpose.</blockquote><p>If in <i>ex</i> text input mode:</p><blockquote>Terminate the current line. If there are no characters other than <b>autoindent</b> characters on the line, allcharacters on the line shall be discarded. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -