pr.html
来自「IEEE 1003.1-2003, Single Unix Specificat」· HTML 代码 · 共 460 行 · 第 1/2 页
HTML
460 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>pr</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="pr"></a> <a name="tag_04_101"></a><!-- pr --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_101_01"></a>NAME</h4><blockquote>pr - print files</blockquote><h4><a name="tag_04_101_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>pr</tt><b>[</b><tt>+</tt><i>page</i><b>][</b><tt>-</tt><i>column</i><b>][</b><tt>-adFmrt</tt><b>][</b><tt>-e</tt><b>[</b><i>char</i><b>][</b><i>gap</i><b>]][</b><tt>-h</tt> <i>header</i><b>][</b><tt>-i</tt><b>[</b><i>char</i><b>][</b><i>gap</i><b>]] <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup><br></b> <tt> </tt> <b>[</b><tt>-l</tt><i>lines</i><b>][</b><tt>-n</tt><b>[</b><i>char</i><b>][</b><i>width</i><b>]][</b><tt>-o</tt><i>offset</i><b>][</b><tt>-s</tt><b>[</b><i>char</i><b>]][</b><tt>-w</tt> <i>width</i><b>][</b><tt><img src="../images/opt-start.gif" border="0">-f<img src="../images/opt-end.gif" border="0">p</tt><b>]<br></b> <tt> </tt> <b>[</b><i>file</i><tt>...</tt><b>]</b></code></p></blockquote><h4><a name="tag_04_101_03"></a>DESCRIPTION</h4><blockquote><p>The <i>pr</i> utility is a printing and pagination filter. If multiple input files are specified, each shall be read, formatted,and written to standard output. By default, the input shall be separated into 66-line pages, each with:</p><ul><li><p>A 5-line header that includes the page number, date, time, and the pathname of the file</p></li><li><p>A 5-line trailer consisting of blank lines</p></li></ul><p>If standard output is associated with a terminal, diagnostic messages shall be deferred until the <i>pr</i> utility hascompleted processing.</p><p>When options specifying multi-column output are specified, output text columns shall be of equal width; input lines that do notfit into a text column shall be truncated. By default, text columns shall be separated with at least one <blank>.</p></blockquote><h4><a name="tag_04_101_04"></a>OPTIONS</h4><blockquote><p>The <i>pr</i> utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap12.html#tag_12_02">Section 12.2, Utility Syntax Guidelines</a>, except that: the <i>page</i> option has a<tt>'+'</tt> delimiter; <i>page</i> and <i>column</i> can be multi-digit numbers; some of the option-arguments are optional; andsome of the option-arguments cannot be specified as separate arguments from the preceding option letter. In particular, the<b>-s</b> option does not allow the option letter to be separated from its argument, and the options <b>-e</b>, <b>-i</b>, and<b>-n</b> require that both arguments, if present, not be separated from the option letter.</p><p>The following options shall be supported. In the following option descriptions, <i>column</i>, <i>lines</i>, <i>offset</i>,<i>page</i>, and <i>width</i> are positive decimal integers; <i>gap</i> is a non-negative decimal integer.</p><dl compact><dt><b>+</b><i>page</i></dt><dd>Begin output at page number <i>page</i> of the formatted input.</dd><dt><b>-</b><i>column</i></dt><dd>Produce multi-column output that is arranged in <i>column</i> columns (the default shall be 1) and is written down each columnin the order in which the text is received from the input file. This option should not be used with <b>-m</b>. The options<b>-e</b> and <b>-i</b> shall be assumed for multiple text-column output. Whether or not text columns are produced with identicalvertical lengths is unspecified, but a text column shall never exceed the length of the page (see the <b>-l</b> option). When usedwith <b>-t</b>, use the minimum number of lines to write the output.</dd><dt><b>-a</b></dt><dd>Modify the effect of the <b>-</b> <i>column</i> option so that the columns are filled across the page in a round-robin order(for example, when <i>column</i> is 2, the first input line heads column 1, the second heads column 2, the third is the second linein column 1, and so on).</dd><dt><b>-d</b></dt><dd>Produce output that is double-spaced; append an extra <newline> following every <newline> found in the input.</dd><dt><b>-e[</b><i>char</i><b>][</b><i>gap</i><b>]</b></dt><dd><br>Expand each input <tab> to the next greater column position specified by the formula <i>n</i>* <i>gap</i>+1, where <i>n</i>is an integer > 0. If <i>gap</i> is zero or is omitted, it shall default to 8. All <tab>s in the input shall be expandedinto the appropriate number of <space>s. If any non-digit character, <i>char</i>, is specified, it shall be used as the input<tab>.</dd><dt><b>-f</b></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Use a <form-feed> for new pages, instead of the default behavior that uses a sequence of <newline>s. Pause beforebeginning the first page if the standard output is associated with a terminal. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd><dt><b>-F</b></dt><dd>Use a <form-feed> for new pages, instead of the default behavior that uses a sequence of <newline>s.</dd><dt><b>-h </b> <i>header</i></dt><dd>Use the string <i>header</i> to replace the contents of the <i>file</i> operand in the page header.</dd><dt><b>-i[</b><i>char</i><b>][</b><i>gap</i><b>]</b></dt><dd>In output, replace multiple <space>s with <tab>s wherever two or more adjacent <space>s reach columnpositions <i>gap</i>+1, 2* <i>gap</i>+1, 3* <i>gap</i>+1, and so on. If <i>gap</i> is zero or is omitted, default tab settings atevery eighth column position shall be assumed. If any non-digit character, <i>char</i>, is specified, it shall be used as theoutput <tab>.</dd><dt><b>-l </b> <i>lines</i></dt><dd>Override the 66-line default and reset the page length to <i>lines</i>. If <i>lines</i> is not greater than the sum of both theheader and trailer depths (in lines), the <i>pr</i> utility shall suppress both the header and trailer, as if the <b>-t</b> optionwere in effect.</dd><dt><b>-m</b></dt><dd>Merge files. Standard output shall be formatted so the <i>pr</i> utility writes one line from each file specified by a<i>file</i> operand, side by side into text columns of equal fixed widths, in terms of the number of column positions.Implementations shall support merging of at least nine <i>file</i> operands.</dd><dt><b>-n[</b><i>char</i><b>][</b><i>width</i><b>]</b></dt><dd><br>Provide <i>width</i>-digit line numbering (default for <i>width</i> shall be 5). The number shall occupy the first <i>width</i>column positions of each text column of default output or each line of <b>-m</b> output. If <i>char</i> (any non-digit character)is given, it shall be appended to the line number to separate it from whatever follows (default for <i>char</i> is a<tab>).</dd><dt><b>-o </b> <i>offset</i></dt><dd>Each line of output shall be preceded by offset <space>s. If the <b>-o</b> option is not specified, the default offsetshall be zero. The space taken is in addition to the output line width (see the <b>-w</b> option below).</dd><dt><b>-p</b></dt><dd>Pause before beginning each page if the standard output is directed to a terminal ( <i>pr</i> shall write an <alert> tostandard error and wait for a <carriage-return> to be read on <b>/dev/tty</b>).</dd><dt><b>-r</b></dt><dd>Write no diagnostic reports on failure to open files.</dd><dt><b>-s[</b><i>char</i><b>]</b></dt><dd>Separate text columns by the single character <i>char</i> instead of by the appropriate number of <space>s (default for<i>char</i> shall be <tab>).</dd><dt><b>-t</b></dt><dd>Write neither the five-line identifying header nor the five-line trailer usually supplied for each page. Quit writing after thelast line of each file without spacing to the end of the page.</dd><dt><b>-w </b> <i>width</i></dt><dd>Set the width of the line to <i>width</i> column positions for multiple text-column output only. If the <b>-w</b> option is notspecified and the <b>-s</b> option is not specified, the default width shall be 72. If the <b>-w</b> option is not specified andthe <b>-s</b> option is specified, the default width shall be 512. <p>For single column output, input lines shall not be truncated.</p></dd></dl></blockquote><h4><a name="tag_04_101_05"></a>OPERANDS</h4><blockquote><p>The following operand shall be supported:</p><dl compact><dt><i>file</i></dt><dd>A pathname of a file to be written. If no <i>file</i> operands are specified, or if a <i>file</i> operand is <tt>'-'</tt> , thestandard input shall be used.</dd></dl></blockquote><h4><a name="tag_04_101_06"></a>STDIN</h4><blockquote><p>The standard input shall be used only if no <i>file</i> operands are specified, or if a <i>file</i> operand is <tt>'-'</tt> .See the INPUT FILES section.</p></blockquote><h4><a name="tag_04_101_07"></a>INPUT FILES</h4><blockquote><p>The input files shall be text files.</p><p>The file <b>/dev/tty</b> shall be used to read responses required by the <b>-p</b> option.</p></blockquote><h4><a name="tag_04_101_08"></a>ENVIRONMENT VARIABLES</h4><blockquote><p>The following environment variables shall affect the execution of <i>pr</i>:</p><dl compact><dt><i>LANG</i></dt><dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> forthe precedence of internationalization variables used to determine the values of locale categories.)</dd><dt><i>LC_ALL</i></dt><dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd><dt><i>LC_CTYPE</i></dt>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?