?? ch12_02.htm
字號:
<html><head><title>Command-Line Invocation (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="ch12_01.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="ch12_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h2 class="sect1">12.2. Command-Line Invocation</h2><p><a name="IXT-12-123356" /><a name="IXT-12-123357" /><a name="IXT-12-123358" /><tt class="literal">nroff</tt> and <tt class="literal">troff</tt> are invoked from the command line as follows:</p><blockquote><pre class="code">nroff [<em class="replaceable"><tt>options</em>] [<em class="replaceable">files</tt></em>]troff [<em class="replaceable"><tt>options</em>] [<em class="replaceable">files</tt></em>]</pre></blockquote><p>Many of the options are the same for both formatters.</p><a name="unut-ch-12-sect-2.1" /><div class="sect2"><h3 class="sect2">12.2.1. nroff/troff Options</h3><dl><dt><tt class="literal">-F</tt><tt><em class="replaceable">dir</em></tt></dt><dd>Search for font tables in directory <em class="emphasis">dir</em></tt>.</p></dd><dt><tt class="literal">-i</tt></dt><dd>Read standard input after <em class="emphasis">files</em></tt> are processed.</p></dd><dt><tt class="literal">-m</tt><tt><em class="replaceable">name</em></tt></dt><dd>Prepend a macro file to input <em class="emphasis">files</em></tt>.Historically, one of <tt class="literal">/usr/lib/tmac/tmac.</tt><em class="emphasis">name</em></tt> or<tt class="literal">/usr/share/lib/tmac/tmac.</tt><em class="emphasis">name</em></tt>were the locations of the macros for <em class="emphasis">name</em></tt>.Solaris uses <tt class="literal">/usr/share/lib/tmac/</tt><em class="emphasis">name</em></tt>.The actual location and filename(s) vary among different Unix systems.</p></dd><dt><tt class="literal">-n</tt><tt><em class="replaceable">N</em></tt> </dt><dd>First output page has page number <em class="emphasis">N</em></tt>.</p></dd><dt><tt class="literal">-o</tt><tt><em class="replaceable">list</em></tt></dt><dd>Print pages contained only in the comma-separated <em class="emphasis">list</em></tt>.Page ranges can be specified as <em class="emphasis">n</em></tt>–<em class="emphasis">m</em></tt>,<tt class="literal">-</tt><em class="emphasis">m</em></tt> (first page through <em class="emphasis">m</em></tt>),or <em class="emphasis">n</em></tt><tt class="literal">-</tt> (<em class="emphasis">n</em></tt> through end of file).</p></dd><dt><tt class="literal">-r</tt><tt><em class="replaceable">aN</em></tt></dt><dd>Set register <em class="emphasis">a</em></tt> to <em class="emphasis">N</em></tt>.The register <em class="emphasis">a</em> is restricted to one-character names.</p></dd><dt><tt class="literal">-s</tt><tt><em class="replaceable">N</em></tt></dt><dd>Stop every <em class="emphasis">n</em></tt> pages. This allows changing a paper cassette.Resume by pressing Return (in <tt class="literal">nroff</tt>) or by pressing thestart button on the typesetter (in <tt class="literal">troff</tt>).</p></dd><dt><tt class="literal">-T</tt><tt><em class="replaceable">name</em></tt></dt><dd>Prepare output designed for printer or typesetter <em class="emphasis">name</em></tt>.For device names, see your specific documentation or a local expert.</p></dd><dt><tt class="literal">-u</tt><tt><em class="replaceable">N</em></tt> </dt><dd>The font in position 3 is overstruck <em class="emphasis">N</em></tt> times.Typically used to adjust the weight of the bold font.</p></dd><dt><tt class="literal">-z</tt></dt><dd>Discard output except messages generated by <tt class="literal">.tm</tt> request(<tt class="literal">otroff</tt> only).</p></dd></dl></div><a name="unut-ch-12-sect-2.2" /><div class="sect2"><h3 class="sect2">12.2.2. nroff-Only Options</h3><dl><dt><tt class="literal">-e</tt></dt><dd>When justifying output lines, space words equally (using terminal resolutioninstead of full space increments).</p></dd><dt><tt class="literal">-h</tt></dt><dd>Hasten output by replacing eight horizontal spaces with a tab.</p></dd><dt><tt class="literal">-q</tt></dt><dd>Invoke simultaneous input/output of <tt class="literal">.rd</tt> requests.</p></dd></dl></div><a name="unut-ch-12-sect-2.3" /><div class="sect2"><h3 class="sect2">12.2.3. troff-Only Options</h3><dl><dt><tt class="literal">-a</tt></dt><dd>Format a printable ASCII approximation. Useful for finding page countswithout producing printed output.</p></dd><dt><tt class="literal">-f</tt></dt><dd>Don't stop the typesetter when formatting is done(<tt class="literal">otroff</tt> only).</p></dd><dt><tt class="literal">-N</tt></dt><dd>Run as <tt class="literal">nroff</tt> instead of as <tt class="literal">troff</tt>(recent versions of <tt class="literal">ditroff</tt> only).</p></dd></dl></div><a name="unut-ch-12-sect-2.4" /><div class="sect2"><h3 class="sect2">12.2.4. Examples</h3><p>Run <tt class="literal">chap1</tt> through the <tt class="literal">tbl</tt> preprocessor, thenformat the result using the <em class="emphasis">mm</em> macros,with register <tt class="literal">N</tt> set to 5(sets the page-numbering style), etc.:</p><blockquote><pre class="code"><tt class="userinput"><b>tbl chap1 | troff -mm -rN5 | </b></tt><em class="replaceable"><tt>spooler</tt></em><tt class="userinput"><b> &</b></tt></pre></blockquote><p>Format <tt class="literal">chap2</tt> using the <em class="emphasis">ms</em> macros;the first page is 7, but printonly pages 8–10, 15, and 18 through the end of the file:</p><blockquote><pre class="code"><tt class="userinput"><b>nroff -ms -n7 -o8-10,15,18- chap2 | col > chap2.txt &</b></tt></pre></blockquote></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="ch12_01.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="ch12_03.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr><tr><td align="left" valign="top" width="228">12. nroff and troff</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">12.3. Conceptual Overview</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 + -