pr.1

来自「早期freebsd实现」· 1 代码 · 共 348 行

1
348
字号
.\" Copyright (c) 1991 Keith Muller..\" Copyright (c) 1993.\"	The Regents of the University of California.  All rights reserved..\".\" This code is derived from software contributed to Berkeley by.\" Keith Muller of the University of California, San Diego..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\"    notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\"    notice, this list of conditions and the following disclaimer in the.\"    documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\"    must display the following acknowledgement:.\"	This product includes software developed by the University of.\"	California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\"    may be used to endorse or promote products derived from this software.\"    without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"     @(#)pr.1	8.3 (Berkeley) 4/18/94.\".Dd April 18, 1994.Dt PR 1.Os BSD 4.4.Sh NAME.Nm pr.Nd print files.Sh SYNOPSIS.Nm pr.Bk -words.Op Ar \&+page.Ek.Bk -words.Op Fl Ar column.Ek.Op Fl adFmrt.Bk -words.Oo.Op Fl e.Op Ar char.Op Ar gap.Oc.Ek.Bk -words.Op Fl h Ar header.Ek.Bk -words.Oo.Op Fl i.Op Ar char.Op Ar gap.Oc.Ek.Bk -words.Op Fl l Ar lines.Ek.Bk -words.Op Fl o Ar offset.Ek.Bk -words.Oo.Op Fl s.Op Ar char.Oc.Ek.Bk -words.Oo.Op Fl n.Op Ar char.Op Ar width.Oc.Ek.Bk -words.Op Fl w Ar width.Ek.Op -.Op Ar file ....Sh DESCRIPTIONThe.Nm prutility is a printing and pagination filter for text files.When multiple input files are specified, each is read, formatted,and written to standard output.By default, the input is separated into 66-line pages, each with.sp.in +2.ti -2\(bu A 5-line header with the page number, date, time, andthe pathname of the file..sp.ti -2\(bu A 5-line trailer consisting of blank lines..in -2.PpIf standard output is associated with a terminal,diagnostic messages are suppressed until the.Nm prutility has completed processing..PpWhen multiple column output is specified,text columns are of equal width.By default text columns are separated by at least one.Em <blank>.Input lines that do not fit into a text column are truncated.Lines are not truncated under single column output..Sh OPTIONS.PpIn the following option descriptions, column, lines, offset, page, andwidth are positive decimal integers and gap is a nonnegative decimal integer..Bl -tag -width 4n.It Ar \&+pageBegin output at page number .Ar pageof the formatted input..It Fl Ar columnProduce output that is .Ar columnswide (default is 1) that is written verticallydown each column in the order in which the textis received from the input file.The options.Fl eand.Fl iare assumed.This option should not be used with.Fl m .When used with.Fl t ,the minimum number of lines is used to display the output..It Fl aModify the effect of the .Fl columnoption so that the columns are filled across the page in a round-robin order(e.g., when column is 2, the first input line heads column1, the second heads column 2, the third is the second linein column 1, etc.).This option requires the use of the.Fl columnoption..It Fl dProduce output that is double spaced. An extra.Em <newline>character is output following every <newline> found in the input..It Fl e Ar \&[char\&]\&[gap\&]Expand each input <tab> to the next greater columnposition specified by the formula .Ar n*gap+1 ,where .Em nis an integer > 0.If.Ar gapis zero or is omitted the default is 8.All .Em <tab>characters in the input are expanded into the appropriatenumber of.Em <space>s .If any nondigit character,.Ar char ,is specified, it is used as the input tab character..It Fl FUse a.Em <form-feed>character for new pages,instead of the default behavior that uses asequence o.Em <newline>characters..It Fl h Ar header.Ar headerUse the string .Ar headerto replace the.Ar file namein the header line..It Fl i Ar \&[char\&]\&[gap\&]In output, replace multiple <space>s with <tab>s whenever two or moreadjacent <space>s reach column positions.Ar gap+1 ,.Ar 2*gap+1 ,etc.If.Ar gapis zero or omitted, default.Em <tab>settings at every eighth column positionis used.If any nondigit character,.Ar char ,is specified, it is used as the output.Em <tab>character..It Fl l Ar linesOverride the 66 line default and reset the page length to .Ar lines.If.Ar linesis not greater than the sum of both the header and trailerdepths (in lines), the .Nm prutility suppresses output of both the header and trailer, as if the.Fl toption were in effect..It Fl mMerge the contents of multiple files.One line from each file specified by a file operand iswritten side by side into text columns of equal fixed widths, interms of the number of column positions.The number of text columns depends on the number offile operands successfully opened.The maximum number of files merged depends on page width and theper process open file limit.The options.Fl eand.Fl iare assumed..It Fl n Ar \&[char\&]\&[width\&]Provide.Ar widthdigit line numbering.The default for .Ar width ,if not specified, is 5.The number occupies the first.Ar widthcolumn positions of each text column or each line of.Fl moutput.If.Ar char(any nondigit character) is given, it is appended to the line number toseparate it from whatever follows. The default for.Ar charis a.Em <tab> .Line numbers longer than.Ar widthcolumns are truncated..It Fl o Ar offsetEach line of output is preceded by.Ar offset.Em <spaces>s .If the.FL ooption is not specified, the default is zero.The space taken is in addition to the output line width..It Fl rWrite no diagnostic reports on failure to open a file..It Fl s Ar charSeparate text columns by the single character.Ar charinstead of by the appropriate number of.Em <space>s(default for .Ar charis the.Em <tab>character)..It Fl tPrint neither the five-line identifyingheader nor the five-line trailer usually supplied for each page.Quit printing after the last line of each file without spacing to theend of the page..It Fl w Ar widthSet the width of the line to.Ar widthcolumn positions for multiple text-column output only.If the.Fl woption is not specified and the.Fl soption is not specified, the default width is 72.If the.Fl woption is not specified and the.Fl soption is specified, the default width is 512..It Ar fileA pathname of a file to be printed.If no.Ar fileoperands are specified, or if a.Ar fileoperand is.Sq Fl ,the standard input is used.The standard input is used only if no.Ar fileoperands are specified, or if a.Ar fileoperand is.Sq Fl ..El.PpThe.Fl soption does not allow the option letter to be separated from itsargument, and the options.Fl e ,.Fl i ,and.Fl nrequire that both arguments, if present, not be separated from the optionletter..Sh ERRORS.PpIf.Nm prreceives an interrupt while printing to a terminal, itflushes all accumulated error messages to the screen beforeterminating..PpThe.Nm prutility exits 0 on success, and 1 if an error occurs..PpError messages are written to standard error during the printingprocess (if output is redirected) or after all successfulfile printing is complete (when printing to a terminal)..Sh SEE ALSO.Xr cat 1 ,.Xr more 1.Sh STANDARDSThe.Nm prutility is.St -p1003.2compatible.

⌨️ 快捷键说明

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