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

📄 ch19_05.htm

📁 unix基础教程
💻 HTM
📖 第 1 页 / 共 3 页
字号:
</dl><h4 class="refsect2">Examples</h4><p>If file <tt class="literal">prog.c</tt> is compiled, and it contains this line of code:</p><blockquote><pre class="code">char rcsID[] = "$Author: ellie $";</pre></blockquote><p>the following output is produced:</p><blockquote><pre class="code">$ <tt class="userinput"><b>ident prog.c prog.o</b></tt>prog.c:     $Author: ellie $prog.o:     $Author: ellie $</pre></blockquote><p>Show keywords for all RCS files (suppress warnings):</p><blockquote><pre class="code">co -p RCS/*,v | ident -q</pre></blockquote></td></tr><tr><td valign="top"><a name="merge">merge</a></td><td><p><tt class="literal">merge</tt> [<em class="replaceable"><tt>options</em>] [<em class="replaceable">diff3 options</em>] <em class="replaceable">file1</em> <em class="replaceable">file2 file3</tt></em></p><p><a name="IXT-19-123594" />Perform a three-way merge of files (via <tt class="literal">diff3</tt>) and place changes in <em class="emphasis">file1</em>.<em class="emphasis">file2</em> is the original file.<em class="emphasis">file1</em> is the &#8220;good&#8221; modification of <em class="emphasis">file2</em>.<em class="emphasis">file3</em> is another, conflicting modification of <em class="emphasis">file2</em>.<tt class="literal">merge</tt> finds the differences between <em class="emphasis">file2</em> and <em class="emphasis">file3</em>,and then incorporates those changes into <em class="emphasis">file1</em>.If both <em class="emphasis">file1</em> and <em class="emphasis">file3</em> have changes to common lines,<tt class="literal">merge</tt> warns about overlapping lines and inserts bothchoices in <em class="emphasis">file1</em>.  The insertion appears as follows:</p><blockquote><pre class="code">&lt;&lt;&lt;&lt;&lt;&lt;&lt; <em class="replaceable"><tt>file1</tt></em><i class="lineannotation">lines from file1&lt;</i>/&gt;========<i class="lineannotation">lines from file3</i>&gt;&gt;&gt;&gt;&gt;&gt;&gt; <em class="replaceable"><tt>file3</tt></em></pre></blockquote><p>You'll need to edit <em class="emphasis">file1</em> by deleting one of the choices.<tt class="literal">merge</tt> exits with a status of 0 (no overlaps), 1 (some overlaps),or 2 (unknown problem).See also <b class="emphasis-bold">rcsmerge</b>.</p><p><tt class="literal">merge</tt> accepts the <tt class="literal">-A</tt>, <tt class="literal">-e</tt>, and <tt class="literal">-E</tt> options for<tt class="literal">diff3</tt>, and simply passes them on, causing <tt class="literal">diff3</tt>to perform the corresponding kind of merge.See the entry for <b class="emphasis-bold">diff3</b> in <a href="ch02_01.htm">Chapter 2</a>,for details. (The <tt class="literal">-A</tt> option isfor the GNU version of <tt class="literal">diff3</tt>.)</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-L</tt> <tt><em class="replaceable">label</em></tt></dt><dd>This option may be provided up to three times, providing different labels in placeof the filenames <em class="emphasis">file1</em></tt>, <em class="emphasis">file2</em></tt>, and<em class="emphasis">file3</em></tt>, respectively.</p></dd><dt><tt class="literal">-p</tt></dt><dd>Send merged version to standard output instead of to <em class="emphasis">file1</em></tt>.</p></dd><dt><tt class="literal">-q</tt></dt><dd>Produce overlap insertions but don't warn about them.</p></dd></dl></td></tr><tr><td valign="top"><a name="rcs">rcs</a></td><td><p><tt class="literal">rcs</tt> [<tt><em class="replaceable"><tt>options</em></tt>] <tt><em class="replaceable">files</tt></em></tt></p><p><a name="IXT-19-123595" />An administrative command forsetting up or changing the default attributes of RCS files.<tt class="literal">rcs</tt> requires you to supply at least one option.(This is for &#8220;future expansion.&#8221;)</p><p>Among other things, <tt class="literal">rcs</tt> lets you set strict locking (<tt class="literal">-L</tt>),delete revisions (<tt class="literal">-o</tt>), and override locks set by <tt class="literal">co</tt>(<tt class="literal">-l</tt> and <tt class="literal">-u</tt>).RCS files have an access list (created via <tt class="literal">-a</tt>); anyone whose usernameis on the list can run <tt class="literal">rcs</tt>.  The access list is oftenempty, meaning that <tt class="literal">rcs</tt> is available to everyone.In addition, you can always invoke <tt class="literal">rcs</tt> if youown the file, if you're a privileged user, or if yourun <tt class="literal">rcs</tt> with <tt class="literal">-i</tt>. <tt class="literal">rcs</tt> accepts the standard options<tt class="literal">-q</tt>,<tt class="literal">-V</tt>,<tt class="literal">-V</tt><em class="emphasis">n</em></tt>,<tt class="literal">-T</tt>,<tt class="literal">-x</tt>,and<tt class="literal">-z</tt>.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-a</tt><tt><em class="replaceable">users</em></tt></dt><dd>Append the comma-separated list of <em class="emphasis">users</em></tt> to the access list.</p></dd><dt><tt class="literal">-A</tt><tt><em class="replaceable">otherfile</em></tt></dt><dd>Append <em class="emphasis">otherfile</em></tt>'s access list to the access list of <em class="emphasis">files</em></tt>.</p></dd><dt><tt class="literal">-b</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Set the default branch to <em class="emphasis">R</em></tt> or, if <em class="emphasis">R</em></tt> is omitted,to thehighest branch on the trunk.</p></dd><dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal">$Log: ch19_05.htm,v $<dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal">Revision 1.2  2002/11/08 17:52:40  ellie<dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal">fixed entities<dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal"><dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal">Revision 1.1  2002/11/04 21:32:22  ellie<dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal">Initial revision<dt><tt class="literal">-c</tt><tt class="literal">'</tt><tt><em class="replaceable">s</em></tt><tt class="literal">'</tt></dt><dd>The comment leader for <tt class="literal"></tt> keywords is set to string <em class="emphasis">s</em></tt>.You could, for example, set <em class="emphasis">s</em></tt> to <tt class="literal">.\"</tt> for <tt class="literal">troff</tt> filesor set <em class="emphasis">s</em></tt> to <tt class="literal">*</tt> forC programs.  (You would need to manually insert an enclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal">$Log: ch19_05.htm,v $enclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal">Revision 1.2  2002/11/08 17:52:40  ellieenclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal">fixed entitiesenclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal">enclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal">Revision 1.1  2002/11/04 21:32:22  ellieenclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal">Initial revisionenclosing <tt class="literal">/*</tt> and <tt class="literal">*/</tt> before and after <tt class="literal"></tt>.)</p><p><tt class="literal">-c</tt> is obsolescent; RCS uses the character(s) preceding<tt class="literal">$Log: ch19_05.htm,v $<tt class="literal">Revision 1.2  2002/11/08 17:52:40  ellie<tt class="literal">fixed entities<tt class="literal"><tt class="literal">Revision 1.1  2002/11/04 21:32:22  ellie<tt class="literal">Initial revision<tt class="literal"></tt> in the file as the comment leader for logmessages.You may wish to set this, though, if you are accessing the RCS file with olderversions of RCS.</p></dd><dt><tt class="literal">-e</tt>[<tt><em class="replaceable">users</em></tt>]</dt><dd></tt>Erase everyone (or only the specified <em class="emphasis">users</em></tt>) from the access list.</p></dd><dt><tt class="literal">-i</tt></dt><dd>Create (initialize) an RCS file, but don't deposit a revision.</p></dd><dt><tt class="literal">-I</tt></dt><dd>Interactive mode; prompt user even when standard input is not a terminal.</p></dd><dt><tt class="literal">-k</tt><tt><em class="replaceable">c</em></tt></dt><dd>Use <em class="emphasis">c</em></tt> as the default style for keyword substitution.(See <b class="emphasis-bold">co</b> for values of <em class="emphasis">c</em></tt>.)<tt class="literal">-kkv</tt> restores the defaultsubstitution style.</p></dd><dt><tt class="literal">-l</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Lock revision <em class="emphasis">R</em></tt> or the latest revision.<tt class="literal">-l</tt> &#8220;retroactively locks&#8221; a file and is useful if you checkedout a file incorrectly by typing <tt class="literal">co</tt> instead of <tt class="literal">co -l</tt>.<tt class="literal">rcs</tt> will ask you if it should break the lock if someoneelse has the file locked.</p></dd><dt><tt class="literal">-L</tt></dt><dd>Turn on strict locking (the default).  This means that everyone, including the ownerof the RCS file, must use <tt class="literal">co -l</tt> to edit files.Strict locking is recommended when files are to be shared.  (See <tt class="literal">-U</tt>.)</p></dd><dt><tt class="literal">-m</tt><tt><em class="replaceable">R</em></tt><tt class="literal">:</tt><tt><em class="replaceable">msg</em></tt></dt><dd>Use the <em class="emphasis">msg</em></tt> string to replace the log message of revision <em class="emphasis">R</em></tt>.</p></dd><dt><tt class="literal">-M</tt></dt><dd>Do not send mail when breaking a lock.This is intended for use by RCS frontends, not for direct useby users!</p></dd><dt><tt class="literal">-n</tt><tt><em class="replaceable">flags</em></tt></dt><dd>Add or delete an association between a revision and a name.<em class="emphasis">flags</em> can be:</p></dd></dl><table border="1" cellpadding="3"><tr><td><em class="replaceable"><tt>name</em><tt class="literal">:</tt><em class="replaceable">R</em></td><td><p>Associate <em class="emphasis">name</em> with revision <em class="emphasis">R</tt></em>.</p></td></tr><tr><td><em class="replaceable"><tt>name</em><tt class="literal">:</tt></td><td><p>Associate <em class="emphasis">name</tt></em> with latest revision.</p></td></tr><tr><td><em class="replaceable"><tt>name</em></td><td><p>Remove association of <em class="emphasis">name</tt></em>.</p></td></tr></table><p><dl><dt><tt class="literal">-N</tt><tt><em class="replaceable">flags</em></tt></dt><dd>Same as <tt class="literal">-n</tt>, but overwrite existing <em class="emphasis">names</em></tt>.</p></dd><dt><tt class="literal">-o</tt><tt><em class="replaceable">R_list</em></tt></dt><dd>Delete (outdate) revisions listed in <em class="emphasis">R_list</em></tt>.<em class="emphasis">R_list</em> can be specified as:  <em class="emphasis">R1</em>,<em class="emphasis">R1</em><tt class="literal">:</tt><em class="emphasis">R2</em>,<em class="emphasis">R1</em><tt class="literal">:</tt>, or <tt class="literal">:</tt><em class="emphasis">R2</em>.When a branch is given,<tt class="literal">-o</tt> deletes only the latest revision on it.The <tt class="literal">-</tt> range separator character fromRCS versions prior to 5.6 is still valid.</p></dd><dt><tt class="literal">-s</tt><tt><em class="replaceable">state</em></tt>[<tt class="literal">:</tt><tt><em class="replaceable">R</em></tt>]</dt><dd>Set the state of revision <em class="emphasis">R</em></tt> (or the latest revision)to the word <em class="emphasis">state</em></tt>.</p></dd><dt><tt class="literal">-t</tt>[<tt><em class="replaceable">file</em></tt>]</dt><dd>Replace RCS file description with contents of <em class="emphasis">file</em></tt>or, if no file is given, with standard input.</p></dd><dt><tt class="literal">-t-</tt><tt><em class="replaceable">string</em></tt></dt><dd>Replace RCS file description with <em class="emphasis">string</em></tt>.</p></dd><dt><tt class="literal">-u</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>The complement of <tt class="literal">-l</tt>:  unlock a revision that was previouslychecked out via <tt class="literal">co -l</tt>.  If someone else did the check-out,you are prompted to state the reason for breaking the lock.This message is mailed to the original locker.</p></dd><dt><tt class="literal">-U</tt></dt><dd>Turn on nonstrict locking.  Everyone except the file owner mustuse <tt class="literal">co -l</tt> to edit files.  (See <tt class="literal">-L</tt>.)</p></dd></dl><h4 class="refsect2">Examples</h4><p>Associate the label <em class="emphasis">To_customer</em></tt> with the latest revision of allRCS files:</p><blockquote><pre class="code"><tt class="userinput"><b>rcs -nTo_customer: RCS/*</b></tt></pre></blockquote><p>Add three users to the access list of file <tt class="literal">beatle_deals</tt>:</p><blockquote><pre class="code"><tt class="userinput"><b>rcs -ageorge,paul,ringo beatle_deals</b></tt></pre></blockquote><p>Delete revisions 1.2 through 1.5:</p><blockquote><pre class="code"><tt class="userinput"><b>rcs -o1.2:1.5 doc</b></tt></pre></blockquote><p>Replace an RCS file description with the contents of a variable:</p><blockquote><pre class="code"><tt class="userinput"><b>echo "$description" | rcs -t </b></tt><tt><em class="replaceable"><tt>file</tt></em></tt></pre></blockquote></td></tr><tr><td valign="top"><a name="rcsclean">rcsclean</a></td><td><p><tt class="literal">rcsclean</tt> [<tt><em class="replaceable"><tt>options</em></tt>] [<tt><em class="replaceable">files</tt></em></tt>]</p><p><a name="IXT-19-123596" />Although included with RCS, this command is optional and might not be installed on your system.<tt class="literal">rcsclean</tt> compares checked-out files againstthe corresponding latest revision or revision <em class="emphasis">R</em></tt>(as given by the options).If no differences are found, the working file is removed.(Use <tt class="literal">rcsdiff</tt> to find differences.)<tt class="literal">rcsclean</tt> is useful in makefiles; for example,you could specify a &#8220;clean-up&#8221; target to update your directories.<tt class="literal">rcsclean</tt> is also useful prior to running <tt class="literal">rcsfreeze</tt>.<tt class="literal">rcsclean</tt> accepts the standard options<tt class="literal">-q</tt>,<tt class="literal">-V</tt>,<tt class="literal">-V</tt><em class="emphasis">n</em></tt>,<tt class="literal">-T</tt>,<tt class="literal">-x</tt>,and<tt class="literal">-z</tt>.</p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-k</tt><tt><em class="replaceable">c</em></tt> </dt><dd>When comparing revisions, expand keywords using style <em class="emphasis">c</em></tt>.(See <b class="emphasis-bold">co</b> for values of <em class="emphasis">c</em>.)</p></dd><dt><tt class="literal">-n</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Show what would happen but don't actually execute.</p></dd><dt><tt class="literal">-r</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Compare against revision <em class="emphasis">R</em></tt>.<em class="emphasis">R</em> can be supplied as arguments to other options,so <tt class="literal">-r</tt> is redundant.</p></dd><dt><tt class="literal">-u</tt>[<tt><em class="replaceable">R</em></tt>]</dt><dd>Unlock the revision if it's the same as the working file.</p></dd>

⌨️ 快捷键说明

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