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

📄 ex.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<h5><a name = "tag_001_014_598_004">&nbsp;</a>Append</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>a<b>[</b>ppend<b>][</b>!<b>]</b><p>Enter input mode; the input text will be placed after the specified line.If line 0 is specified, the text will be placed at the beginning of thebuffer.The current line indicator will be setto the last input line; if no lines are input, it will be set to thetarget line, or to the first line of the file if a target of 0 wasspecified.Following the command name with<b>!</b>causes the<b>autoindent</b>editor option setting to be toggledfor the duration of this command only.<h5><a name = "tag_001_014_598_005">&nbsp;</a>Arguments</h5><i>Synopsis</i>:   ar<b>[</b>gs<b>]</b><p>Write the argument list with the current argument inside "[" and "]".The argument list is the listof operands on start-up, which can subsequently be replaced bythe operands of the<b>next</b>command.<h5><a name = "tag_001_014_598_006">&nbsp;</a>Change</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>]</b> c<b>[</b>hange<b>][</b>!<b>] [</b><i>count</i><b>]</b><p>Enter input mode; the input text will replace the specified lines(<i>range</i>).The current line indicator will be setto the last line input; if no lines were input, it will be set to theline before the target line, or to the first line of the file if thereare no lines preceding the target.Following the command name with"!"causes the<b>autoindent</b>editor option setting to be toggled forthe duration of this command only.<h5><a name = "tag_001_014_598_007">&nbsp;</a>Change Directory</h5><i>Synopsis</i>:   chd<b>[</b>ir<b>][</b>!<b>] [</b><i>directory</i><b>]</b><br><i>Synopsis</i>:   cd<b>[</b>!<b>] [</b><i>directory</i><b>]</b><p>Change the current working directory to<i>directory</i>.The argument will be subjected to the process of shell word expansions (see<xref href=wordexp><a href="chap2.html#tag_001_006">Word Expansions</a></xref>).When invoked with no<i>directory</i>argument, and the<i>HOME</i>environment variable is set to a non-empty value, the directory name in the<i>HOME</i>environment variable will become the new working directory.If<i>HOME</i>is empty or undefined, the default behaviour is implementation-dependent.If the current buffer has been modified since the last write, awarning will be written and the command will fail.This warning can be overridden by appending"!"to the command name,which will allow the command to complete.<h5><a name = "tag_001_014_598_008">&nbsp;</a>Copy</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>co<b>[</b>py<b>] </b><i>line </i><b>[</b><i>flags</i><b>]</b><br><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>t <i>line </i><b>[</b><i>flags</i><b>]</b><p>Place a copy of the specified lines(<i>range</i>)after the specified destination<i>line</i>;line 0 specifies that the lines will be placed at the beginning of thebuffer.<h5><a name = "tag_001_014_598_009">&nbsp;</a>Delete</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>d<b>[</b>elete<b>] [</b><i>buffer</i><b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]</b><p>Delete the specified lines from the buffer.If a named<i>buffer</i>is specified, the deleted text will be saved in it;otherwise, the deleted text will be saved in the unnamed buffer.If thecommand name is followed by a letter that could beinterpreted as either a buffer name or a<i>flag</i>value (because neither a<i>count</i>nor an additional<i>flags</i>value was given),<i>ex</i>will consider the letter to be a<i>flags</i>value if the letter directly follows the command name,without anyblank characterseparation; if the letter is preceded byone of more blank characters,it is considered a buffer name.<p>For example:<dl compact><dt><b>1dp&nbsp;</b>or<b>&nbsp;1deletep</b><dd>Deletes the first line and prints theline that was second.<dt><b>1d&nbsp;p</b><dd>Deletes the first line, saving it in bufferp.<dt><b>1d&nbsp;p1l</b><dd>(Pee-one-ell.)Deletes the first line, saving it in bufferp,and listing the line that was second.</dl><p>The current line indicator will be set to the line followingthe deleted lines,or to the last line if the deleted lines were at the end.<h5><a name = "tag_001_014_598_010">&nbsp;</a>Edit</h5><i>Synopsis</i>:   e<b>[</b>dit<b>][</b>!<b>] [</b>+<i>line</i><b>] [</b><i>file</i><b>]</b><br><i>Synopsis</i>:   ex<b>[</b>!<b>] [</b>+<i>line</i><b>] [</b><i>file</i><b>]</b><p>Begin editing<i>file</i>.If the current buffer has been modified since the last write,a warning will be written and the command will be aborted.This action can be overridden by appending the character"!"to thecommand name(e!<i>file</i>).The current line indicator will be affected as follows:<ul><p><li>If<i>file</i>is omitted or results in the current file, the current line indicatorwill not be changed.<p><li>Otherwise, the current line indicator will be the last line of the buffer;however, if this command is executed from within visual mode, the currentline indicator will be the first line of the buffer.<p></ul><p>If the+<i>line</i>option is specified, the current line indicator will be set to thespecified position, where<i>line</i>can be a number (or "$")or specified as &quot;<b>/</b><i>pattern</i>&quot; or &quot;<b>?</b><i>pattern</i>&quot;.Preceding the pattern with a "/" will start a search from thebeginning of the file.Preceding the pattern with a"?"will start a search from the end of the file.This command is affected by the editor options<b>autowrite</b>and<b>writeany</b>.<h5><a name = "tag_001_014_598_011">&nbsp;</a>File</h5><i>Synopsis</i>:   f<b>[</b>ile<b>] [</b><i>file</i><b>]</b><p>Write the current pathname, the numberof lines, and the current position when no<i>file</i>argument has been specified;<i>ex</i>may write other unspecified information.If no current file has yet been established,an unspecified messagewill be writtento indicate that no file is being edited.With<i>file</i>,<i>ex</i>will change the current filename to<i>file</i>without changing the contents of the buffer or the previouscurrent file.<h5><a name = "tag_001_014_598_012">&nbsp;</a>Global</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>g<b>[</b>lobal<b>] </b>/<i>pattern</i>/ <b>[</b><i>commands</i><b>]</b><br><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>v /<i>pattern</i>/ <b>[</b><i>commands</i><b>]</b><p>Mark the lines within the given range that match(g)or do not match(v)the given pattern.Then execute the<i>ex</i>commands given by<i>commands</i>with the current line(.)set to each marked line.The<i>range</i>defaults to the entire file.<p>Multiple<i>commands</i>can be specified, one per line, by escaping eachnewline characterwith a backslash.If<i>commands</i>are omitted, each line will be written.For the<b>append</b>,<b>change</b>and<b>insert</b>commands, theinput text will be included as part of the<b>global</b>command line;in this case the terminating period can be omitted if it ends<i>commands</i>.The<b>visual</b>command can be specified as one of the<i>commands</i>.In this mode, input will be taken from the terminal.Entering aQfrom visual mode causes the next line matching the patternto be selected and visual mode to be reentered, until the listis exhausted.<p>The<b>global</b>command itself and the<b>undo</b>command cannot be used in<i>commands</i>.The editor options<b>autoprint</b>,<b>autoindent</b>and<b>report</b>will be inhibitedfor the duration of the<b>g</b>or<b>v</b>command.<h5><a name = "tag_001_014_598_013">&nbsp;</a>Insert</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>i<b>[</b>nsert<b>][</b>!<b>]</b><p>Enter input mode;the input text will be placed before the specified line.The current line indicator will be setto the last line input; if no lines were input, it will be set to theline before the target line, or to the first line of the file if thereare no lines preceding the target.Following the command name with the character"!"causes the<b>autoindent</b>editor option setting to be toggled forthe duration of this command only.<h5><a name = "tag_001_014_598_014">&nbsp;</a>Join</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>j<b>[</b>oin<b>][</b>!<b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]</b><p>Join the text from the specified lines together into one line.In the POSIX locale, when the last character on the first line of a pairof lines to be joined is a period, twospace characterswill be added followingthe period; whenthe last character of the first line is ablank characteror when the firstcharacter on the second line of the pair is a")",nospace characterswill be added; otherwise, onespace characterwill be added following the last character of the first line.Extrablank charactersat the start of a line will be discarded.<p>Appending a character"!"to the<b>join</b>command name causes a simpler join with no white-spaceprocessing, independent of the current locale.<h5><a name = "tag_001_014_598_015">&nbsp;</a>List</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>l<b>[</b>ist<b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]</b><p>Write the addressed lines in a way that should be unambiguous:non-printable characterswill be written as implementation-dependent multi-character sequences;the end of the line will be marked with a "$".<p>Long lines will be folded;the length at which folding occurs is unspecified,but should be appropriate for the output device.The only useful flag is"#",for line numbers.The current line indicator will be set to the last line written.<h5><a name = "tag_001_014_598_016">&nbsp;</a>Map</h5><i>Synopsis</i>:   map<b>[</b>!<b>] [</b><i>x rhs</i><b>]</b><p>Define macros for use in visual mode.The first argument must be a single characteror the sequence#<i>digit</i>(the latter meaning one of the terminal's numberedfunction keys).When this character or function keyis typed in visual mode,the action will be as if the corresponding<i>rhs</i>had been typed.If the character"!"is appended to the command name<b>map</b>,the mapping is effectiveduring input mode rather than command mode.This allows<i>x</i>to have two different macro definitions at the same time:one for command mode and one for input mode.Non-printable characters,except for atab character,require escaping with a&lt;control&gt;-V(or&lt;control&gt;-Q)to be entered in the arguments.On certain block-mode terminals, the mapping need not occur immediately(for example, it may occur after the terminal transmits a groupof characters to the system),but it will achieve the same results of modifying the fileas if it occurred immediately.Implementations may restrict the set of commands accepted within<i>rhs</i>;the list of restrictions is implementation-dependent.<p>The<b>map</b>command with no arguments will write allof the macros currently defined.If"!"is appended to the command, only the macros effective during input modewill be written; otherwise, only the macros effective duringcommand mode will be written.<h5><a name = "tag_001_014_598_017">&nbsp;</a>Mark</h5><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>ma<b>[</b>rk<b>] </b><i>x</i><br><i>Synopsis</i>:   <b>[</b><i>line</i><b>] </b>k <i>x</i><p>Give the specified line the specified mark<i>x</i>,which must be asingle lower-case letter of the POSIX locale.The current line position will not be affected.The expression'<i>x</i>can then be used as an address in any command requiring one.For example&quot;<b>.,'</b><i>x</i><b>d</b>&quot;deletes all the lines from the current one to the marked line.Also see the<i><a href="vi.html">vi</a></i>``and''commandsfor uses of the mark in visual mode.If the'<i>x</i>command is used innon-visual mode, the charactermarked will be the firstnon-blankcharacter of the current line.Otherwise, the character marked will be thecharacter at the current column of the current line.<h5><a name = "tag_001_014_598_018">&nbsp;</a>Move</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>m<b>[</b>ove<b>] </b><i>line</i><p>Move the specified lines(<i>range</i>)to be after the target line(<i>line</i>).The current line indicator will be set to the first of the moved lines.<h5><a name = "tag_001_014_598_019">&nbsp;</a>Next</h5><i>Synopsis</i>:   n<b>[</b>ext<b>][</b>!<b>] [</b><i>file ...</i><b>]</b><p>Edit the next file from the argument list.If the current buffer has been modified since thelast write, a warning will be written and the command will be aborted.This action can be overridden by appending the character"!"to the command name(n!).The argument list canbe replaced by specifying a new one as operands to this command.Editing then starts with the first file on this new list.The current line indicator will be reset as described for the<b>edit</b>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_020">&nbsp;</a>Number</h5><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b>nu<b>[</b>mber<b>] [</b><i>count</i><b>] [</b><i>flags</i><b>]</b><br><i>Synopsis</i>:   <b>[</b><i>range</i><b>] </b># <b>[</b><i>count</i><b>] [</b><i>flags</i><b>]</b><p>Write the selected lines, each preceded with its line number in decimal.Non-printable characters,except for atab character,will be expanded as specified by the<b>print</b>command.The format is as follows:<p><code><tt>"%+6d\t%s"</tt>, &lt;<i>line number</i>&gt;,&lt;<i>line text</i>&gt;</code><p>The only meaningful flag isl,which causes the additionalexpanded writing oftab charactersand end-of-lines done by the<b>list</b>

⌨️ 快捷键说明

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