ch17_04.htm

来自「unix基础教程」· HTM 代码 · 共 321 行 · 第 1/2 页

HTM
321
字号
<html><head><title>refer (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 &amp; 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="ch17_03.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="part4.htm"><img src="../gifs/txtnexta.gif" alt="Next" border="0" /></a></td></tr></table></div><h2 class="sect1">17.4. refer</h2><p><a name="ch17.troff1d" /><a name="ch17.troff2d" /><a name="ch17.troff3d" /><a name="ch17.troff4d" /><a name="ch17.troff4e" />Along with several associated commands,<tt class="literal">refer</tt> is a preprocessor formanaging a database of bibliographic references.The database is kept in a separate file, and short referenceswithin a document are replaced by an expanded formal version.</p><p>The alphabetical command summary at the end of this sectionlists the usage and options for <tt class="literal">refer</tt> andthe other commands that work with bibliographic databases.</p><p><tt class="literal">refer</tt> is not supplied with SVR4, but it isa standard part of Solaris.</p><a name="unut-ch-17-sect-4.1" /><div class="sect2"><h3 class="sect2">17.4.1. Bibliographic Entries</h3><p>Bibliographic databases are text files, with each entry separated from thenext by one or more blank lines.Within an entry, each field consists of a key letter (givenas <tt class="literal">%</tt><em class="emphasis">letter</em>) and associated value.Values may continue onto subsequent lines, ending at the next linethat starts with a <tt class="literal">%</tt>.For example:</p><blockquote><pre class="code">%T 5-by-5 Palindromic Word Squares%A M.D. McIlroy%J Word Ways%V 9%P 199-202%D 1976</pre></blockquote><p>Except for <tt class="literal">%A</tt> (the author),fields should only be supplied once.Irrelevant or inapplicable fields should not be provided.</p><table border="1" cellpadding="3"><tr><th><em class="emphasis">Key</em></th><th><em class="emphasis">Meaning</em></th></tr><tr><td><tt class="literal">%A</tt></td><td><p>Author's name</p></td></tr><tr><td><tt class="literal">%B</tt></td><td><p>Book containing article </p></td></tr><tr><td><tt class="literal">%C</tt></td><td><p>City (place where published)</p></td></tr><tr><td><tt class="literal">%D</tt></td><td><p>Date of publication</p></td></tr><tr><td><tt class="literal">%E</tt></td><td><p>Editor of book containing article</p></td></tr><tr><td><tt class="literal">%F</tt></td><td><p>Footnote number or label (supplied by <tt class="literal">refer</tt>)</p></td></tr><tr><td><tt class="literal">%G</tt></td><td><p>Government order number</p></td></tr><tr><td><tt class="literal">%H</tt></td><td><p>Header commentary, printed before reference</p></td></tr><tr><td><tt class="literal">%I</tt></td><td><p>Issuer (publisher)</p></td></tr><tr><td><tt class="literal">%J</tt></td><td><p>Journal containing article</p></td></tr><tr><td><tt class="literal">%K</tt></td><td><p>Keywords to use in locating reference</p></td></tr><tr><td><tt class="literal">%L</tt></td><td><p>Label field used by <tt class="literal">refer -k</tt></p></td></tr><tr><td><tt class="literal">%M</tt></td><td><p>Bell Labs Memorandum</p></td></tr><tr><td><tt class="literal">%N</tt></td><td><p>Number within volume</p></td></tr><tr><td><tt class="literal">%O</tt></td><td><p>Other commentary, printed at end of reference</p></td></tr><tr><td><tt class="literal">%P</tt></td><td><p>Page number(s)</p></td></tr><tr><td><tt class="literal">%Q</tt></td><td><p>Corporate or Foreign Author (unreversed)</p></td></tr><tr><td><tt class="literal">%R</tt></td><td><p>Report, paper, or thesis (unpublished)</p></td></tr><tr><td><tt class="literal">%S</tt></td><td><p>Series title</p></td></tr><tr><td><tt class="literal">%T</tt></td><td><p>Title of article or book</p></td></tr><tr><td><tt class="literal">%V</tt></td><td><p>Volume number</p></td></tr><tr><td><tt class="literal">%X</tt></td><td><p>Abstract (used by <tt class="literal">roffbib</tt>, not <tt class="literal">refer</tt>)</p></td></tr><tr><td><tt class="literal">%Y</tt>, <tt class="literal">%Z</tt></td><td><p>Ignored by <tt class="literal">refer</tt></p></td></tr></table><p></div><a name="unut-ch-17-sect-4.2" /><div class="sect2"><h3 class="sect2">17.4.2. General Coding Scheme</h3><p>In a document, use of <tt class="literal">refer</tt> might look like this:</p><blockquote><pre class="code">Palindromes are fun.Very large ones can be used to impress your friends.Palindromic word squares.[%A McIlroy.]are even more amazing,and should be reserved for impressing your boss.....SH REFERENCES.[$LIST$.]</pre></blockquote><p>The document shown here uses <tt class="literal">refer</tt>'s collection mode (<tt class="literal">-e</tt>),where all the references are printed at the endof the document, instead of at each place they are referenced.</p></div><a name="unut-ch-17-sect-4.3" /><div class="sect2"><h3 class="sect2">17.4.3. Alphabetical Summary of Commands</h3><table border="1" cellpadding="5"><tr><td valign="top"><a name="addbib">addbib</a></td><td><p><tt class="literal">addbib</tt> [<em class="replaceable"><tt>options</em>] <em class="replaceable">database</tt></em></p><p>Interactively add bibliography records to <em class="emphasis">database</em>.<a name="IXT-17-123471" /></p><h4 class="refsect2">Options</h4><dl><dt><tt class="literal">-a</tt></dt><dd>Don't prompt for an abstract.</p></dd><dt><tt class="literal">-p</tt> <tt><em class="replaceable">file</em></tt></dt><dd>Use <em class="emphasis">file</em></tt> as the prompting &#8220;skeleton.&#8221;Eachline should be a prompt, a tab, and then the key letter to write.</p></dd></dl></td></tr><tr><td valign="top"><a name="indxbib">indxbib</a></td><td><p><tt class="literal">indxbib</tt> <em class="replaceable"><tt>files</tt></em></p><p><a name="IXT-17-123472" />Create an inverted index for <tt class="literal">refer</tt>bibliographic database files.These are then used by <tt class="literal">lookbib</tt> and <tt class="literal">refer</tt>.</p><h4 class="refsect2">Generated files</h4><p>For each original file <em class="emphasis">x</em>,<tt class="literal">indxbib</tt> creates four new files.</p><table border="1" cellpadding="3"><tr><td><em class="emphasis">x</em><tt class="literal">.ia</tt></td><td><p>The entry file</p></td></tr><tr><td><em class="emphasis">x</em><tt class="literal">.ib</tt></td><td><p>The posting file</p></td></tr><tr><td><em class="emphasis">x</em><tt class="literal">.ic</tt></td><td><p>The tag file</p></td></tr><tr><td><em class="emphasis">x</em><tt class="literal">.ig</tt></td><td><p>The reference file</p></td></tr></table><p></td></tr><tr><td valign="top"><a name="lookbib">lookbib</a></td><td><p><tt class="literal">lookbib</tt> <em class="replaceable"><tt>database</tt></em></p><p><a name="IXT-17-123473" />Search a bibliographic database created by <tt class="literal">indxbib</tt>.<tt class="literal">lookbib</tt> prompts with a <tt class="literal">&gt;</tt> signfor keywords and prints all records matching the keyword.If none are found, only another <tt class="literal">&gt;</tt> prompt appears.While <tt class="literal">lookbib</tt> works without the inverted indexfiles created by <tt class="literal">indxbib</tt>, such operation is slower.See also <b class="emphasis-bold"><a href="#addbib">addbib</a></b> and <b class="emphasis-bold"><a href="#indxbib">indxbib</a></b>.</td></tr>

⌨️ 快捷键说明

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