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

📄 ex.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
📖 第 1 页 / 共 5 页
字号:
regular expression, the sequence <tt>"\/"</tt> shall represent a literal slash instead of the regular expression delimiter.</p></li><li><p>A regular expression enclosed in question marks ( <tt>'?'</tt> ) shall address the first line found by searching backwards fromthe line preceding the current line toward the beginning of the edit buffer and stopping at the first line for which the lineexcluding the terminating &lt;newline&gt; matches the regular expression. An address consisting of a null regular expressiondelimited by question marks <tt>"??"</tt> shall address the previous line for which the line excluding the terminating&lt;newline&gt; matches the last regular expression encountered. In addition, the second question mark can be omitted at the end ofa command line. If the <b>wrapscan</b> edit option is set, the search shall wrap around from the beginning of the edit buffer tothe end of the edit buffer and continue up to and including the current line, so that the entire edit buffer is searched. Withinthe regular expression, the sequence <tt>"\?"</tt> shall represent a literal question mark instead of the RE delimiter.</p></li><li><p>A plus sign ( <tt>'+'</tt> ) or a minus sign ( <tt>'-'</tt> ) followed by a decimal number shall address the current line plusor minus the number. A <tt>'+'</tt> or <tt>'-'</tt> not followed by a decimal number shall address the current line plus or minus1.</p></li></ol><p>Addresses can be followed by zero or more address offsets, optionally &lt;blank&gt;-separated. Address offsets are constructedas follows:</p><ol><li><p>A <tt>'+'</tt> or <tt>'-'</tt> immediately followed by a decimal number shall add (subtract) the indicated number of lines to(from) the address. A <tt>'+'</tt> or <tt>'-'</tt> not followed by a decimal number shall add (subtract) 1 to (from) theaddress.</p></li><li><p>A decimal number shall add the indicated number of lines to the address.</p></li></ol><p>It shall not be an error for an intermediate address value to be less than zero or greater than the last line in the editbuffer. It shall be an error for the final address value to be less than zero or greater than the last line in the edit buffer.</p><p>Commands take zero, one, or two addresses; see the descriptions of <i>1addr</i> and <i>2addr</i> in <a href="#tag_04_45_13_10">Command Descriptions in ex</a> . If more than the required number of addresses are provided to a command thatrequires zero addresses, it shall be an error. Otherwise, if more than the required number of addresses are provided to a command,the addresses specified first shall be evaluated and then discarded until the maximum number of valid addresses remain.</p><p>Addresses shall be separated from each other by a comma ( <tt>','</tt> ) or a semicolon ( <tt>';'</tt> ). If no address isspecified before or after a comma or semicolon separator, it shall be as if the address of the current line was specified before orafter the separator. In the case of a semicolon separator, the current line ( <tt>'.'</tt> ) shall be set to the first address, andonly then will the next address be calculated. This feature can be used to determine the starting line for forwards and backwardssearches (see rules 5. and 6.).</p><p>A percent sign ( <tt>'%'</tt> ) shall be equivalent to entering the two addresses <tt>"1,$"</tt> .</p><p>Any delimiting &lt;blank&gt;s between addresses, address separators, or address offsets shall be discarded.</p><h5><a name="tag_04_45_13_03"></a>Command Line Parsing in ex</h5><p>The following symbol is used in this and following sections to describe parsing behavior:</p><dl compact><dt><i>escape</i></dt><dd>If a character is referred to as &quot;backslash-escaped&quot; or &quot; &lt;control&gt;-V-escaped,&quot; it shall mean that the characteracquired or lost a special meaning by virtue of being preceded, respectively, by a backslash or &lt;control&gt;-V character. Unlessotherwise specified, the escaping character shall be discarded at that time and shall not be further considered for anypurpose.</dd></dl><p>Command-line parsing shall be done in the following steps. For each step, characters already evaluated shall be ignored; thatis, the phrase &quot;leading character&quot; refers to the next character that has not yet been evaluated.</p><ol><li><p>Leading colon characters shall be skipped.</p></li><li><p>Leading &lt;blank&gt;s shall be skipped.</p></li><li><p>If the leading character is a double-quote character, the characters up to and including the next non-backslash-escaped&lt;newline&gt; shall be discarded, and any subsequent characters shall be parsed as a separate command.</p></li><li><p>Leading characters that can be interpreted as addresses shall be evaluated; see <a href="#tag_04_45_13_02">Addressing in ex</a>.</p></li><li><p>Leading &lt;blank&gt;s shall be skipped.</p></li><li><p>If the next character is a vertical-line character or a &lt;newline&gt;:</p><ol type="a"><li><p>If the next character is a &lt;newline&gt;:</p><ol><li><p>If <i>ex</i> is in open or visual mode, the current line shall be set to the last address specified, if any.</p></li><li><p>Otherwise, if the last command was terminated by a vertical-line character, no action shall be taken; for example, the command<tt>"||&lt;newline&gt;"</tt> shall execute two implied commands, not three.</p></li><li><p>Otherwise, step 6.b. shall apply.</p></li></ol></li><li><p>Otherwise, the implied command shall be the <b>print</b> command. The last <b>#</b>, <b>p</b>, and <b>l</b> flags specified toany <i>ex</i> command shall be remembered and shall apply to this implied command. Executing the <i>ex</i> <b>number</b>,<b>print</b>, or <b>list</b> command shall set the remembered flags to <b>#</b>, nothing, and <b>l</b>, respectively, plus anyother flags specified for that execution of the <b>number</b>, <b>print</b>, or <b>list</b> command.</p><p>If <i>ex</i> is not currently performing a <b>global</b> or <b>v</b> command, and no address or count is specified, the currentline shall be incremented by 1 before the command is executed. If incrementing the current line would result in an address past thelast line in the edit buffer, the command shall fail, and the increment shall not happen.</p></li><li><p>The &lt;newline&gt; or vertical-line character shall be discarded and any subsequent characters shall be parsed as a separatecommand.</p></li></ol></li><li><p>The command name shall be comprised of the next character (if the character is not alphabetic), or the next character and anysubsequent alphabetic characters (if the character is alphabetic), with the following exceptions:</p><ol type="a"><li><p>Commands that consist of any prefix of the characters in the command name <b>delete</b>, followed immediately by any of thecharacters <tt>'l'</tt> , <tt>'p'</tt> , <tt>'+'</tt> , <tt>'-'</tt> , or <tt>'#'</tt> shall be interpreted as a <b>delete</b>command, followed by a &lt;blank&gt;, followed by the characters that were not part of the prefix of the <b>delete</b> command. Themaximum number of characters shall be matched to the command name <b>delete</b>; for example, <tt>"del"</tt> shall not be treatedas <tt>"de"</tt> followed by the flag <b>l</b>.</p></li><li><p>Commands that consist of the character <tt>'k'</tt> , followed by a character that can be used as the name of a mark, shall beequivalent to the mark command followed by a &lt;blank&gt;, followed by the character that followed the <tt>'k'</tt> .</p></li><li><p>Commands that consist of the character <tt>'s'</tt> , followed by characters that could be interpreted as valid options to the<b>s</b> command, shall be the equivalent of the <b>s</b> command, without any pattern or replacement values, followed by a&lt;blank&gt;, followed by the characters after the <tt>'s'</tt> .</p></li></ol></li><li><p>The command name shall be matched against the possible command names, and a command name that contains a prefix matching thecharacters specified by the user shall be the executed command. In the case of commands where the characters specified by the usercould be ambiguous, the executed command shall be as follows:</p><center><table border="1" cellpadding="3" align="center"><tr valign="top"><td align="left"><p class="tent"><b>a</b></p></td><td align="left"><p class="tent"><b>append</b></p></td><td align="left"><p class="tent">n</p></td><td align="left"><p class="tent"><b>next</b></p></td><td align="left"><p class="tent"><b>t</b></p></td><td align="left"><p class="tent">t</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><tr valign="top"><td align="left"><p class="tent"><b>c</b></p></td><td align="left"><p class="tent"><b>change</b></p></td><td align="left"><p class="tent">p</p></td><td align="left"><p class="tent"><b>print</b></p></td><td align="left"><p class="tent"><b>u</b></p></td><td align="left"><p class="tent">undo</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><tr valign="top"><td align="left"><p class="tent"><b>ch</b></p></td><td align="left"><p class="tent"><b>change</b></p></td><td align="left"><p class="tent">pr</p></td><td align="left"><p class="tent"><b>print</b></p></td><td align="left"><p class="tent"><b>un</b></p></td><td align="left"><p class="tent">undo</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><tr valign="top"><td align="left"><p class="tent"><b>e</b></p></td><td align="left"><p class="tent"><b>edit</b></p></td><td align="left"><p class="tent">r</p></td><td align="left"><p class="tent"><b>read</b></p></td><td align="left"><p class="tent"><b>v</b></p></td><td align="left"><p class="tent">v</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><tr valign="top"><td align="left"><p class="tent"><b>m</b></p></td><td align="left"><p class="tent"><b>move</b></p></td><td align="left"><p class="tent">re</p></td><td align="left"><p class="tent"><b>read</b></p></td><td align="left"><p class="tent"><b>w</b></p></td><td align="left"><p class="tent">write</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><tr valign="top"><td align="left">

⌨️ 快捷键说明

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