📄 ch18_07.htm
字号:
<html><head><title>sccs and Pseudo-Commands (UNIX in a Nutshell: System V Edition)</title><link rel="stylesheet" type="text/css" href="../style/style1.css" /><meta name="DC.Creator" content="Arnold Robbins" /><meta name="DC.Format" content="text/xml" scheme="MIME" /><meta name="DC.Language" content="en-US" /><meta name="DC.Publisher" content="O'Reilly & Associates, Inc." /><meta name="DC.Source" scheme="ISBN" content="1-56592-427-4" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="UNIX in a Nutshell: System V Edition" /><meta name="DC.Type" content="Text.Monograph" /></head><body bgcolor="#ffffff"><img src="gifs/smbanner.gif" usemap="#banner-map" border="0" alt="Book Home" /><map name="banner-map"><area shape="rect" coords="1,-2,616,66" href="index.htm" alt="Book Title" /><area shape="rect" coords="629,-11,726,25" href="jobjects/fsearch.htm" alt="Search this book" /></map><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch18_06.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228" /><td align="right" valign="top" width="228"><a href="ch19_01.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h2 class="sect1">18.7. sccs and Pseudo-Commands</h2><p><a name="ch18comm5" /><a name="ch18comm6" /><a name="ch18comm7" />The compatibility packages include <tt class="literal">sccs</tt>, a front-end to the SCCS utility. This command provides a moreuser-friendly interface to SCCS and has the following command-line syntax:</p><blockquote><pre class="code">sccs [<em class="replaceable"><tt>options</em>] <em class="replaceable">command</em> [<em class="replaceable">SCCS_flags</em>] [<em class="replaceable">files</tt></em>]</pre></blockquote><p>In addition to providing all the regular SCCS commands,<tt class="literal">sccs</tt> offers pseudo-commands. These areeasy-to-use, prebuilt combinations of the regular SCCS commands.<em class="emphasis">options</em> apply only to the <tt class="literal">sccs</tt> interface.<em class="emphasis">command</em> is the SCCS command or pseudo-command to run,and <em class="emphasis">SCCS_flags</em> are specific options passed to the SCCS command being run.</p><p><tt class="literal">sccs</tt> makes it easier to specify files becauseit automatically prepends <tt class="literal">SCCS/s.</tt> to any filename arguments.For example:</p><blockquote><pre class="code"><tt class="userinput"><b>sccs get -e file.c</b></tt></pre></blockquote><p>would be interpreted as:</p><blockquote><pre class="code"><tt class="userinput"><b>get -e SCCS/s.file.c</b></tt></pre></blockquote><p>Thus, when using <tt class="literal">sccs</tt>, you would first make a directorynamed <tt class="literal">SCCS</tt> to hold all the <tt class="literal">s.</tt> SCCS files.</p><a name="unut-ch-18-sect-6.1" /><div class="sect2"><h3 class="sect2">18.7.1. Options</h3><dl><dt><tt class="literal">-d</tt><tt><em class="replaceable">prepath</em></tt></dt><dd>Locate files in <em class="emphasis">prepath</em></tt> rather than in current directory.For example:</p><blockquote><pre class="code"><tt class="userinput"><b>sccs -d/home get file.c</b></tt></pre></blockquote><p>is interpreted as:</p><blockquote><pre class="code"><tt class="userinput"><b>get /home/SCCS/s.file.c</b></tt></pre></blockquote></dd><dt><tt class="literal">-p</tt><tt><em class="replaceable">endpath</em></tt></dt><dd>Access files from directory <em class="emphasis">endpath</em></tt> instead of <tt class="literal">SCCS</tt>.For example:</p><blockquote><pre class="code"><tt class="userinput"><b>sccs -pVERSIONS get file.c</b></tt></pre></blockquote><p>is interpreted as:</p><blockquote><pre class="code"><tt class="userinput"><b>get VERSIONS/s.file.c</b></tt></pre></blockquote></dd><dt><tt class="literal">-r</tt></dt><dd>Invoke <tt class="literal">sccs</tt> as the real user instead of as the effective user.</p></dd></dl></div><a name="unut-ch-18-sect-6.2" /><div class="sect2"><h3 class="sect2">18.7.2. Pseudo-Commands</h3><p>Equivalent SCCS actions are indicated in parentheses.</p><dl><dt><tt class="literal">check</tt></dt><dd>Like <tt class="literal">info</tt>, but<a name="IXT-18-123528" />return nonzero exit codes instead of filenames.</p></dd><dt><tt class="literal">clean</tt></dt><dd><a name="IXT-18-123529" />Remove from current directory any files that aren't being editedunder SCCS (via <tt class="literal">get -e</tt>, for example).</p></dd><dt><tt class="literal">create</tt></dt><dd><a name="IXT-18-123530" />Create SCCS files (<tt class="literal">admin -i</tt> followed by <tt class="literal">get</tt>).</p></dd><dt><tt class="literal">deledit</tt></dt><dd><a name="IXT-18-123531" />Same as <tt class="literal">delta</tt> followed by <tt class="literal">get -e</tt>.</p></dd><dt><tt class="literal">delget</tt></dt><dd><a name="IXT-18-123532" />Same as <tt class="literal">delta</tt> followed by <tt class="literal">get</tt>.</p></dd><dt><tt class="literal">diffs</tt></dt><dd><a name="IXT-18-123533" />Compare file's current version and SCCS version (like <tt class="literal">sccsdiff</tt>).</p></dd><dt><tt class="literal">edit</tt></dt><dd><a name="IXT-18-123534" />Get a file to edit (<tt class="literal">get -e</tt>).</p></dd><dt><tt class="literal">enter</tt></dt><dd><a name="IXT-18-123535" />Like <tt class="literal">create</tt>, but without the subsequent <tt class="literal">get</tt>(<tt class="literal">admin -i</tt>).</p></dd><dt><tt class="literal">fix</tt></dt><dd><a name="IXT-18-123536" />Same as <tt class="literal">rmdel</tt> (must be followed by <tt class="literal">-r</tt>).</p></dd><dt><tt class="literal">info</tt></dt><dd><a name="IXT-18-123537" />List files being edited (similar to <tt class="literal">sact</tt>).</p></dd><dt><tt class="literal">print</tt></dt><dd><a name="IXT-18-123538" />Print information (like <tt class="literal">prs -e</tt>followed by <tt class="literal">get -p -m</tt>).</p></dd><dt><tt class="literal">tell</tt></dt><dd><a name="IXT-18-123539" />Like <tt class="literal">info</tt>, but list one filename per line.</p></dd><dt><tt class="literal">unedit</tt></dt><dd><a name="IXT-18-123540" />Same as <tt class="literal">unget</tt>.</p></dd></dl></div><a name="unut-ch-18-sect-6.3" /><div class="sect2"><h3 class="sect2">18.7.3. Solaris Notes</h3><ul><li><p>SCCS is not available unless you have done at leasta developer-system install.<a name="IXT-18-123541" /></p></li><li><p><a name="IXT-18-123542" /><a name="IXT-18-123543" />The environment variable PROJECTDIR specifies a location where<tt class="literal">sccs</tt> searches for SCCS files.There are two possible kinds of values you can use.</p><dl><dt><i><em class="emphasis">An absolute pathname</em></tt></i></dt><dd><tt class="literal">sccs</tt> searches for SCCS files in the directory namedby $PROJECTDIR.</p></dd><dt><i><em class="emphasis">A username</em></tt></i></dt><dd><tt class="literal">sccs</tt> looks in the <tt class="literal">src</tt> or <tt class="literal">source</tt>subdirectory of the given user's home directory.</p></dd></dl></li></ul><a name="IXT-18-123544" /><a name="IXT-18-123545" /><a name="IXT-18-123546" /><a name="IXT-18-123547" /><a name="IXT-18-123548" /></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch18_06.htm"><img src="../gifs/txtpreva.gif" alt="Previous" border="0" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img src="../gifs/txthome.gif" alt="Home" border="0" /></a></td><td align="right" valign="top" width="228"><a href="ch19_01.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">18.6. Alphabetical Summary of SCCS Commands</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img src="../gifs/index.gif" alt="Book Index" border="0" /></a></td><td align="right" valign="top" width="228">19. The Revision Control System</td></tr></table></div><hr width="684" align="left" /><img src="../gifs/navbar.gif" usemap="#library-map" border="0" alt="Library Navigation Links" /><p><p><font size="-1"><a href="copyrght.htm">Copyright © 2003</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,88,96" href="../index.htm"><area shape="rect" coords="90,0,165,96" href="../upt/index.htm"><area shape="rect" coords="168,1,253,107" href="../mac/index.htm"><area shape="rect" coords="255,0,335,97" href="../korn/index.htm"><area shape="rect" coords="337,0,415,109" href="../unixnut/index.htm"><area shape="rect" coords="417,0,512,122" href="../sedawk/index.htm"><area shape="rect" coords="514,0,605,105" href="../lunix/index.htm"><area shape="rect" coords="611,2,694,121" href="../vi/index.htm"></map></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -