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

📄 ex.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
command to be performed.The current line indicator will be set to the last line written.<h5><a name = "tag_001_014_598_021">&nbsp;</a>Open</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>o<b>[</b>pen<b>]</b> /<i>pattern</i>/ <b>[</b><i>flags</i><b>]</b><p>Enter open mode, which is equivalentto visual mode with a one-line window.All the visual mode commands are available.If a match is found for the optional regular expression in<i>line</i>,the cursor will be placed at the start of the matching pattern.The visual mode command<b>Q</b>(see<i><a href="vi.html">vi</a></i>)will exit open mode.This command need not be supported on block-mode terminals.<h5><a name = "tag_001_014_598_022">&nbsp;</a>Preserve</h5><i>Synopsis</i>:   pre<b>[</b>serve<b>]</b><p>Save the current buffer in a form that canlater be recovered by using<i>ex</i><b>-r</b>or by using the<b>recover</b>command.After the file has been preserved,a mail message will be sent to the user.This message can be read by invoking the<i><a href="mailx.html">mailx</a></i>utility.The message will contain the name of the file,the time of preservation, and an<i>ex</i>command that could be used to recover the file.Additional information may be included inthe mail message.<h5><a name = "tag_001_014_598_023">&nbsp;</a>Print</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>p<b>[</b>rint<b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]</b><p>Write the addressed lines.Non-printable characters,except for thetab character,will be written as implementation-dependent multi-character sequences.<p>Long lines will be folded;the length at which folding occurs is unspecified,but should be appropriate for the output device.The only meaningful<i>flags</i>are"#"andl.The current line indicator will be set to the last line written.<h5><a name = "tag_001_014_598_024">&nbsp;</a>Put</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>pu<b>[</b>t<b>] [</b><i>buffer</i><b>]</b><p>Put back deleted or yanked lines after line<i>line</i>.A buffer can be specified;otherwise, the text in the unnamed buffer(where deleted or yanked text is placed by default) will be restored.The current line indicator will be set to the first line put back.<h5><a name = "tag_001_014_598_025">&nbsp;</a>Quit</h5><i>Synopsis</i>:   q<b>[</b>uit<b>][</b>!<b>]</b><p>Terminate the editing session.If the current buffer has been modified sincethe last write, a warning will be writtenand the command will fail.This warning can be overriddenand an exit forced, discarding changes,by appending the character"!"to the command name.<h5><a name = "tag_001_014_598_026">&nbsp;</a>Read</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>r<b>[</b>ead<b>][</b>!<b>] [</b><i>file</i><b>]</b><p>Place a copy of the specified file in thecurrent buffer after the target line(which can be line 0 to place text at the beginning).If no<i>file</i>is named, the current file is the default.If there is no current file, then<i>file</i>will become the current file.If there is no current file nor<i>file</i>operand, the command will fail.<p>The current line indicator will be set to the last line read.In visual mode, the current line indicator will be set to the first line read.If<i>file</i>is preceded by"!",<i>file</i>is taken tobe an operating system command and passed to the program named in the<i>SHELL</i>environment variable;the resultant output will be read in to the buffer.The special meaning of"!"can be overridden by escaping it with a backslash character.<h5><a name = "tag_001_014_598_027">&nbsp;</a>Recover</h5><i>Synopsis</i>:   rec<b>[</b>over<b>]</b><i> file</i><p>Attempt to recover<i>file</i>if it was saved as theresult of a<b>preserve</b>command, the receipt of a signal (see the ASYNCHRONOUS EVENTSsection), or a system or editor crash.The current line indicator will be reset as described for the<b>read</b>editor command.<h5><a name = "tag_001_014_598_028">&nbsp;</a>Rewind</h5><i>Synopsis</i>:   rew<b>[</b>ind<b>][</b>!<b>]</b><p>Rewind the argument list; that is, thecurrent file will be set to the first file in the argument list.This is equivalent to a<b>next</b>command with the currentargument list as its operands.If the current buffer has beenmodified since the last write, a warning will be written andthe command will be aborted.The action can be overridden byappending the character"!"to the command name(rew!).The current line indicator will be reset as described for the<b>read</b>editor command.This command is affected by the editor options<b>autowrite</b>and<b>writeany</b>;see<xref href=exedops><a href="#tag_001_014_598_052">Edit Options in ex</a></xref>for details.<h5><a name = "tag_001_014_598_029">&nbsp;</a>Set</h5><i>Synopsis</i>:   se<b>[</b>t<b>] [</b><i>option</i><b>[</b>=<b>[</b><i>value</i><b>]] </b>...<b>] [</b>no<i>option</i> ...<b>] [</b><i>option</i>? ...<b>] [</b>all<b>]</b><p>When no arguments are specified,write those options whose values havebeen changed from the default settings;when the argument<b>all</b>is specified, write all of the option values.<p>Giving an option name followed by the character"?"causes the current value of thatoption to be written.The"?"can be separated from theoption name by zero or moreblank characters.The"?"is necessary only for Boolean valued options.Boolean options can be given values by the form<b>se</b><i>option</i>to turnthem on orse no<i>option</i>to turn them off;string and numeric options can be assigned by the formse<i>option</i>Blank charactersin strings canbe included as isby preceding each such character with a backslash.More than one option can be set or listed by a single<b>set</b>command by specifying multiple arguments,each separated from the next by one or more blank characters.<p>See<xref href=exedops><a href="#tag_001_014_598_052">Edit Options in ex</a></xref>for further details about options.<h5><a name = "tag_001_014_598_030">&nbsp;</a>Shell</h5><i>Synopsis</i>:   sh<b>[</b>ell<b>]</b><p>Invoke the program named in the<i>SHELL</i>environment variable with the argument<b>-i</b>(interactive mode).Editing will be resumed when the program exits.<h5><a name = "tag_001_014_598_031">&nbsp;</a>Source</h5><i>Synopsis</i>:   so<b>[</b>urce<b>] </b><i>file</i><p>Read and execute commands from the file specifiedby the mandatory argument<i>file</i>.Such<b>so</b>commands can be nested.The maximum supported nesting depth is implementation-dependent,but will be at least one.<h5><a name = "tag_001_014_598_032">&nbsp;</a>Substitute</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>s<b>[</b>ubstitute<b>] [</b>/<i>pattern</i>/<i>repl</i>/<b>[</b><i>options</i><b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]]</b><p>Replace the first instance of the pattern<i>pattern</i>by the string<i>repl</i>on each specified line.(See<xref href=exre><a href="#tag_001_014_598_050">Regular Expressions in ex</a></xref>and<xref href=exrep><a href="#tag_001_014_598_051">Replacement Strings in ex</a></xref>.)If the<b>/</b><i>pattern</i><b>/</b><i>repl</i><b>/</b>argument is not present, the<b>/</b><i>pattern</i><b>/</b><i>repl</i><b>/</b>from the previous<b>substitute</b>command will be used.If<i>options</i>includes the letter<b>g</b>(global), all non-overlapping instancesof the pattern in the line will be substituted.If the option letter<b>c</b>(confirm) is included, then before each substitutionthe line will be written with^characters written on the following line,adjacent to and identifying the pattern to be replaced;an affirmative responsecauses the substitution to be done, while any otherinput aborts it.An affirmative response consists of a line with theaffirmative response (as defined by the current locale) at thebeginning of the line.Such a line will be subject to editing in the sameway as the command line (the "/" or ":"line at the bottom of the screen).The current line indicator will be set to the last line substituted.When the<b>c</b>option is used, typing the interrupt character or receivingthe SIGINT signal will stop the substitute operation and<i>ex</i>will return to command mode.All substitutions completed before theinterrupt occurred will be retained, and none will be made afterthat point.The current line indicator will be set to the last line substituted.This command is affected by the<i>LC_MESSAGES</i>environment variable and the<b>wrapscan</b>option.<h5><a name = "tag_001_014_598_033">&nbsp;</a>Suspend</h5><i>Synopsis</i>:   su<b>[</b>spend<b>][</b>!<b>]</b><br><i>Synopsis</i>:   st<b>[</b>op<b>][</b>!<b>]</b><p>Allow control to return to the invoking process;<i>ex</i>will suspend itself as if it had received the SIGTSTP signal.The suspension will occur only if job controlis enabled in the invoking shell (see the description of<i>set</i><b>-m</b>).<p>Following either<b>suspend</b>or<b>stop</b>with the character"!"will affect the operation of the<b>autowrite</b>editor option for this command only.<p>The current<b>susp</b>character (see<i><a href="stty.html">stty</a></i>)will also cause the suspension.<h5><a name = "tag_001_014_598_034">&nbsp;</a>Tag</h5><i>Synopsis</i>:   ta<b>[</b>g<b>][</b>!<b>] </b><i>tagstring</i><p>Search for the<i>tagstring</i>,which can be in adifferent file.If the tag is in a different file, thenthe new file will be opened for editing.If the current buffer has been modified since the last write,a warning will be written and the command will be aborted.The action can be overridden by appending the character"!"to the command name.The current line indicator will be reset to the line indicated by the tag.This command is affected by the editor options<b>autowrite</b>and<b>writeany</b>;see<xref href=exedops><a href="#tag_001_014_598_052">Edit Options in ex</a></xref>and<i><a href="ctags.html">ctags</a></i>for details.This command is affected by the<b>tags</b>editor option.<p>The<b>tag</b>command will search for<i>tagstring</i>in the tag file referred to by the<b>tags</b>editor option until a reference to<i>tagstring</i>is found.The file pointed to by this reference will be loadedinto the buffer, and the current line will be set tothe first occurrence of thepattern specified in the tag file associated with the supplied<i>tagstring</i>;if the tag file contained a line-number reference,the current line will be set to that line.If the pattern or line numberis not found, an error message will be written.If a file referred to by the<b>tags</b>editor option does not exist or is not readable,an error message will be written.The results are unspecified if the format of a tags fileis not as specified by the<i><a href="ctags.html">ctags</a></i>utility description.<h5><a name = "tag_001_014_598_035">&nbsp;</a>Unabbreviate</h5><i>Synopsis</i>:   una<b>[</b>bbrev<b>] </b><i>word</i><p>Delete<i>word</i>from the list of abbreviations,as described by the<b>abbrev</b>editor command.<h5><a name = "tag_001_014_598_036">&nbsp;</a>Undo</h5><i>Synopsis</i>:   u<b>[</b>ndo<b>]</b><p>Reverse the changes made by the previous editing command(one that changes the contents of the buffer).For this purpose,<b>global</b>and<b>visual</b>are consideredsingle commands.An<b>undo</b>can itself be reversed.Commands that affect the external environment, such as<b>write</b>,<b>edit</b>and<b>next,</b>cannot be undone.<h5><a name = "tag_001_014_598_037">&nbsp;</a>Unmap</h5><i>Synopsis</i>:   unm<b>[</b>ap<b>][</b>!<b>] </b><i>x</i><p>If no"!"is specified, remove the command-mode macro definition for<i>x</i>;otherwise,remove the input-mode macro definition for<i>x</i>.See the<b>map</b>command.<h5><a name = "tag_001_014_598_038">&nbsp;</a>Visual</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>vi<b>[</b>sual<b>] [</b><i>type</i><b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]</b><p>Enter visual mode with the current line indicator set to<i>line</i>.The<i>type</i>is optional, and can be "-", ".", "+" or "^", as in the<b>z</b>command, to specify the position of the specified line on thescreen window.(The default is to place the line at the top of the screen window.)A<i>count</i>specifies the number of lines thatwill initially be written;the default is the value of the editor option<b>window</b>.The command<b>Q</b>will exit visual mode.(For more information, see<i><a href="vi.html">vi</a></i>.)This command need not be supported on block-mode terminals.<h5><a name = "tag_001_014_598_039">&nbsp;</a>Write</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>w<b>[</b>rite<b>][</b>!<b>] [</b>&gt;&gt;<b>] [</b><i>file</i><b>]</b><br><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>w<b>[</b>rite<b>] [</b>!<b>] [</b><i>file</i><b>]</b><br><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>wq<b>[</b>!<b>] [</b>&gt;&gt;<b>] [</b><i>file</i><b>]</b><p>Write the specified lines (the whole buffer, if no<i>range</i>is given) out tothe file represented by the pathname<i>file</i>,writing to standard output the number of lines and bytes written.<p>If<i>file</i>is specified and is not the current file, andthe file named by<i>file</i>exists,then the write will fail.If the current file has been changed by the<b>file</b>command and that file exists, the write will fail.In either case, the write can be forced by appending the character"!"to the command name.An existing file can be appended to by appending&gt;&gt;to the command name.If the file does not exist, the result isimplementation-dependent.

⌨️ 快捷键说明

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