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

📄 ex.html

📁 IEEE 1003.1-2003, Single Unix Specification v3
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<p>Prompt for text input on a new line after the current line. If the <b>autoindent</b> edit option is set, an appropriate numberof <b>autoindent</b> characters shall be added as a prefix to the line as described by the <i>ex</i> <b>autoindent</b> editoption.</p></blockquote><h5><a name="tag_04_45_13_07"></a>&lt;backslash&gt;</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>&lt;backslash&gt;</tt></pre></dd></dl><p>Allow the entry of a subsequent &lt;newline&gt; or &lt;control&gt;-J as a literal character, removing any special meaning thatit may have to the editor during text input mode. The backslash character shall be retained and evaluated when the command line isparsed, or retained and included when the input text becomes part of the edit buffer.</p><h5><a name="tag_04_45_13_08"></a>&lt;control&gt;-V</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>&lt;control&gt;-V</tt></pre></dd></dl><p>Allow the entry of any subsequent character as a literal character, removing any special meaning that it may have to the editorduring text input mode. The &lt;control&gt;-V character shall be discarded before the command line is parsed or the input textbecomes part of the edit buffer.</p><p>If the &quot;literal next&quot; functionality is performed by the underlying system, it is implementation-defined whether a characterother than &lt;control&gt;-V performs this function.</p><h5><a name="tag_04_45_13_09"></a>&lt;control&gt;-W</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>&lt;control&gt;-W</tt></pre></dd></dl><p>Discard the &lt;control&gt;-W, and the word previous to it in the input line, including any &lt;blank&gt;s following the wordand preceding the &lt;control&gt;-W. If the &quot;word erase&quot; functionality is performed by the underlying system, it isimplementation-defined whether a character other than &lt;control&gt;-W performs this function.</p><h5><a name="tag_04_45_13_10"></a>Command Descriptions in ex</h5><p>The following symbols are used in this section to represent command modifiers. Some of these modifiers can be omitted, in whichcase the specified defaults shall be used.</p><dl compact><dt><i>1addr</i></dt><dd>A single line address, given in any of the forms described in <a href="#tag_04_45_13_02">Addressing in ex</a> ; the defaultshall be the current line ( <tt>'.'</tt> ), unless otherwise specified. <p>If the line address is zero, it shall be an error, unless otherwise specified in the following command descriptions.</p><p>If the edit buffer is empty, and the address is specified with a command other than <b>=</b>, <b>append</b>, <b>insert</b>,<b>open</b>, <b>put</b>, <b>read</b>, or <b>visual</b>, or the address is not zero, it shall be an error.</p></dd><dt><i>2addr</i></dt><dd>Two addresses specifying an inclusive range of lines. If no addresses are specified, the default for <i>2addr</i> shall be thecurrent line only ( <tt>".,."</tt> ), unless otherwise specified in the following command descriptions. If one address isspecified, <i>2addr</i> shall specify that line only, unless otherwise specified in the following command descriptions. <p>It shall be an error if the first address is greater than the second address.</p><p>If the edit buffer is empty, and the two addresses are specified with a command other than the <b>!</b>, <b>write</b>,<b>wq</b>, or <b>xit</b> commands, or either address is not zero, it shall be an error.</p></dd><dt><i>count</i></dt><dd>A positive decimal number. If <i>count</i> is specified, it shall be equivalent to specifying an additional address to thecommand, unless otherwise specified by the following command descriptions. The additional address shall be equal to the lastaddress specified to the command (either explicitly or by default) plus <i>count</i>-1. <p>If this would result in an address greater than the last line of the edit buffer, it shall be corrected to equal the last lineof the edit buffer.</p></dd><dt><i>flags</i></dt><dd>One or more of the characters <tt>'+'</tt> , <tt>'-'</tt> , <tt>'#'</tt> , <tt>'p'</tt> , or <tt>'l'</tt> (ell). The flagcharacters can be &lt;blank&gt;-separated, and in any order or combination. The characters <tt>'#'</tt> , <tt>'p'</tt> , and<tt>'l'</tt> shall cause lines to be written in the format specified by the <b>print</b> command with the specified <i>flags</i>. <p>The lines to be written are as follows:</p><ol><li><p>All edit buffer lines written during the execution of the <i>ex</i> <b>&amp;</b>, <b>&#152;</b>, <b>list</b>, <b>number</b>,<b>open</b>, <b>print</b>, <b>s</b>, <b>visual</b>, and <b>z</b> commands shall be written as specified by <i>flags</i>.</p></li><li><p>After the completion of an <i>ex</i> command with a flag as an argument, the current line shall be written as specified by<i>flags</i>, unless the current line was the last line written by the command.</p></li></ol><p>The characters <tt>'+'</tt> and <tt>'-'</tt> cause the value of the current line after the execution of the <i>ex</i> command tobe adjusted by the offset address as described in <a href="#tag_04_45_13_02">Addressing in ex</a> . This adjustment shall occurbefore the current line is written as described in 2. above.</p><p>The default for <i>flags</i> shall be none.</p></dd><dt><i>buffer</i></dt><dd>One of a number of named areas for holding text. The named buffers are specified by the alphanumeric characters of the POSIXlocale. There shall also be one &quot;unnamed&quot; buffer. When no buffer is specified for editor commands that use a buffer, the unnamedbuffer shall be used. Commands that store text into buffers shall store the text as it was before the command took effect, andshall store text occurring earlier in the file before text occurring later in the file, regardless of how the text region wasspecified. Commands that store text into buffers shall store the text into the unnamed buffer as well as any specified buffer. <p>In <i>ex</i> commands, buffer names are specified as the name by itself. In open or visual mode commands the name is preceded bya double quote ( <tt>' )'</tt> character.</p><p>If the specified buffer name is an uppercase character, and the buffer contents are to be modified, the buffer shall be appendedto rather than being overwritten. If the buffer is not being modified, specifying the buffer name in lowercase and uppercase shallhave identical results.</p><p>There shall also be buffers named by the numbers 1 through 9. In open and visual mode, if a region of text including charactersfrom more than a single line is being modified by the <a href="../utilities/vi.html"><i>vi</i></a> <b>c</b> or <b>d</b> commands,the motion character associated with the <b>c</b> or <b>d</b> commands specifies that the buffer text shall be in line mode, or thecommands <b>%</b>, <b>`</b>, <b>/</b>, <b>?</b>, <b>(</b>, <b>)</b>, <b>N</b>, <b>n</b>, <b>{</b>, or <b>}</b> are used to define aregion of text for the <b>c</b> or <b>d</b> commands, the contents of buffers 1 through 8 shall be moved into the buffer named bythe next numerically greater value, the contents of buffer 9 shall be discarded, and the region of text shall be copied into buffer1. This shall be in addition to copying the text into a user-specified buffer or unnamed buffer, or both. Numeric buffers can bespecified as a source buffer for open and visual mode commands; however, specifying a numeric buffer as the write target of an openor visual mode command shall have unspecified results.</p><p>The text of each buffer shall have the characteristic of being in either line or character mode. Appending text to a non-emptybuffer shall set the mode to match the characteristic of the text being appended. Appending text to a buffer shall cause thecreation of at least one additional line in the buffer. All text stored into buffers by <i>ex</i> commands shall be in line mode.The <i>ex</i> commands that use buffers as the source of text specify individually how buffers of different modes are handled. Eachopen or visual mode command that uses buffers for any purpose specifies individually the mode of the text stored into the bufferand how buffers of different modes are handled.</p></dd><dt><i>file</i></dt><dd>Command text used to derive a pathname. The default shall be the current pathname, as defined previously, in which case, if nocurrent pathname has yet been established it shall be an error, except where specifically noted in the individual commanddescriptions that follow. If the command text contains any of the characters <tt>'&#152;'</tt> , <tt>'{'</tt> , <tt>'['</tt> ,<tt>'*'</tt> , <tt>'?'</tt> , <tt>'$'</tt> , <tt>'`'</tt> , <tt>'&quot;</tt> , <tt>' ,'</tt> and <tt>'\'</tt> , it shall be subjectedto the process of &quot;shell expansions&quot;, as described below; if more than a single pathname results and the command expects onlyone, it shall be an error. <p>The process of shell expansions in the editor shall be done as follows. The <i>ex</i> utility shall pass two arguments to theprogram named by the shell edit option; the first shall be <b>-c</b>, and the second shall be the string <tt>"echo"</tt> and thecommand text as a single argument. The standard output and standard error of that command shall replace the command text.</p></dd><dt><b>!</b></dt><dd>A character that can be appended to the command name to modify its operation, as detailed in the individual commanddescriptions. With the exception of the <i>ex</i> <b>read</b>, <b>write</b>, and <b>!</b> commands, the <tt>'!'</tt> charactershall only act as a modifier if there are no &lt;blank&gt;s between it and the command name.</dd><dt><i>remembered&nbsp;search&nbsp;direction</i></dt><dd><br>The <a href="../utilities/vi.html"><i>vi</i></a> commands <b>N</b> and <b>n</b> begin searching in a forwards or backwardsdirection in the edit buffer based on a remembered search direction, which is initially unset, and is set by the <i>ex</i><b>global</b>, <b>v</b>, <b>s</b>, and <b>tag</b> commands, and the <a href="../utilities/vi.html"><i>vi</i></a> <b>/</b> and<b>?</b> commands.</dd></dl><h5><a name="tag_04_45_13_11"></a>Abbreviate</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>ab</tt><b>[</b><i>breviate</i><b>][</b><i>lhs rhs</i><b>]</b></pre></dd></dl><p>If <i>lhs</i> and <i>rhs</i> are not specified, write the current list of abbreviations and do nothing more.</p><p>Implementations may restrict the set of characters accepted in <i>lhs</i> or <i>rh</i>, except that printable characters and&lt;blank&gt;s shall not be restricted. Additional restrictions shall be implementation-defined.</p><p>In both <i>lhs</i> and <i>rhs</i>, any character may be escaped with a &lt;control&gt;-V, in which case the character shall notbe used to delimit <i>lhs</i> from <i>rhs</i>, and the escaping &lt;control&gt;-V shall be discarded.</p><p>In open and visual text input mode, if a non-word or &lt;ESC&gt; character that is not escaped by a &lt;control&gt;-V characteris entered after a word character, a check shall be made for a set of characters matching <i>lhs</i>, in the text input enteredduring this command. If it is found, the effect shall be as if <i>rhs</i> was entered instead of <i>lhs</i>.</p><p>The set of characters that are checked is defined as follows:</p><ol><li><p>If there are no characters inserted before the word and non-word or &lt;ESC&gt; characters that triggered the check, the set ofcharacters shall consist of the word character.</p></li><li><p>If the character inserted before the word and non-word or &lt;ESC&gt; characters that triggered the check is a word character,the set of characters shall consist of the characters inserted immediately before the triggering characters that are wordcharacters, plus the triggering word character.</p></li><li><p>If the character inserted before the word and non-word or &lt;ESC&gt; characters that triggered the check is not a wordcharacter, the set of characters shall consist of the characters that were inserted before the triggering characters that areneither &lt;blank&gt;s nor word characters, plus the triggering word character.</p></li></ol><p>It is unspecified whether the <i>lhs</i> argument entered for the <i>ex</i> <b>abbreviate</b> and <b>unabbreviate</b> commandsis replaced in this fashion. Regardless of whether or not the replacement occurs, the effect of the command shall be as if thereplacement had not occurred.</p><p><i>Current line</i>: Unchanged.</p><p><i>Current column</i>: Unchanged.</p><h5><a name="tag_04_45_13_12"></a>Append</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>1addr</i><b>]</b> <tt>a</tt><b>[</b><tt>ppend</tt><b>][</b><tt>!</tt><b>]</b></pre></dd></dl><p>Enter <i>ex</i> text input mode; the input text shall be placed after the specified line. If line zero is specified, the textshall be placed at the beginning of the edit buffer.</p><p>This command shall be affected by the <b>number</b> and <b>autoindent</b> edit options; following the command name with<tt>'!'</tt> shall cause the <b>autoindent</b> edit option setting to be toggled for the duration of this command only.</p><p><i>Current line</i>: Set to the last input line; if no lines were input, set to the specified line, or to the first line of theedit buffer if a line of zero was specified, or zero if the edit buffer is empty.</p><p><i>Current column</i>: Set to non- &lt;blank&gt;.</p><h5><a name="tag_04_45_13_13"></a>Arguments</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><tt>ar</tt><b>[</b><i>gs</i><b>]</b></pre></dd></dl><p>Write the current argument list, with the current argument-list entry, if any, between <tt>'['</tt> and <tt>']'</tt>characters.</p><p><i>Current line</i>: Unchanged.</p><p><i>Current column</i>: Unchanged.</p><h5><a name="tag_04_45_13_14"></a>Change</h5><dl compact><dt><i>Synopsis</i>:</dt><dd><pre><b>[</b><i>2addr</i><b>]</b> <tt>c</tt><b>[</b><tt>hange</tt><b>][</b><tt>!</tt><b>][</b><i>count</i><b>]</b></pre></dd></dl><p>Enter <i>ex</i> text input mode; the input text shall replace the specified lines. The specified lines shall be copied into theunnamed buffer, which shall become a line mode buffer.</p><p>This command shall be affected by the <b>number</b> and <b>autoindent</b> edit options; following the command name with<tt>'!'</tt> shall cause the <b>autoindent</b> edit option setting to be toggled

⌨️ 快捷键说明

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