xref: /csrg-svn/old/pr/pr.1 (revision 44957)
143083Scael.\" Copyright (c) 1990 The Regents of the University of California.
243083Scael.\" All rights reserved.
319255Smckusick.\"
443083Scael.\" %sccs.include.redist.man%
519255Smckusick.\"
6*44957Scael.\"     @(#)pr.1	6.3 (Berkeley) 07/24/90
743083Scael.\"
843083Scael.Dd
943083Scael.Dt PR 1
10*44957Scael.Os BSD 4.3+Reno
1143083Scael.Sh NAME
1243083Scael.Nm pr
1343083Scael.Nd Print files.
1443083Scael.Sh SYNOPSIS
15*44957Scael.Nm pr
1643083Scael.Oo
17*44957Scael.Op Cm \&+ Ar page
1843083Scael.Op Fl Ar column
19*44957Scael.Oo
2043083Scael.Op Fl f
2143083Scael.Op Fl hheader
2243083Scael.Op Fl llines
2343083Scael.Op Fl m
24*44957Scael.Oo
2543083Scael.Op Fl s Ar char
26*44957Scael.Oo
2743083Scael.Op Fl t
28*44957Scael.Oo
2943083Scael.Op Fl w Ar width
30*44957Scael.Oo
3143083Scael.Ar
3243083Scael.Sh DESCRIPTION
3343083ScaelThe
3443083Scael.Nm pr
3543083Scaelutility is a printing and pagination filter.
3643083ScaelIf multiple
3743083Scaelinput files are specified, each is read, formatted,
3843083Scaeland written to standard output.
3943083ScaelBy default, the input is
4043083Scaelseparated into pages, each with a header that includes the
4143083Scaelpage number, date, time, and the file's pathname.
4243083ScaelText
4343083Scaelcolumns are of equal width, with at least one <blank>
4443083Scaelseparation between text columns.
4543083ScaelLines that do not fit into
4643083Scaela text column are truncated.
4743083ScaelIf standard output is associated
4843083Scaelwith a terminal, diagnostic messages are suppressed
49*44957Scaeluntil the
50*44957Scael.Nm
51*44957Scaelutility has completed processing.
5243083Scael.Pp
5343083ScaelThe following options are available:
5443083Scael.Tw Fl
55*44957Scael.Tc Cm \&+
56*44957Scael.Ar page
57*44957Scael.Cx
5843083ScaelBegin output at page number page of the
5943083Scaelformatted input.
60*44957Scael.Tc Fl
61*44957Scael.Ar column
62*44957Scael.Cx
6343083ScaelProduce output that is columns wide (default
6443083Scaelis 1) and is in text column rank order.
6543083ScaelThis
66*44957Scaeloption should not be used with
67*44957Scael.Fl m .
6843083ScaelWhen
69*44957Scaelused with
70*44957Scael.Fl t ,
71*44957Scaeluse the minimum number of lines
7243083Scaelto display the output.
7343083Scael.Tp Fl f
7443083ScaelUse <form-feed> character for new pages,
7543083Scaelinstead of the default behavior that uses a
7643083Scaelsequence of <newline> characters.
7743083ScaelPrior to
7843083Scaeldisplaying the first page of output an
7943083Scael<alert> character is written to standard output.
8043083Scael.Tp Cx  Fl h
8143083Scael.Ar header
8243083Scael.Cx
8343083ScaelUse the string header as the header to be
8443083Scaelprinted instead of file.
8543083Scael.Tp Cx Fl l
8643083Scael.Ar lines
8743083Scael.Cx
8843083ScaelOverride the 66 line default and reset the
8943083Scaelpage length to lines.
9043083ScaelIf lines is smaller
9143083Scaelthan the sum of both the header and trailer
9243083Scaeldepths (in lines), the pr utility suppresses
93*44957Scaelboth the header and trailer, as if the
94*44957Scael.Fl t
9543083Scaeloption were in effect.
9643083Scael.Tp Fl m
9743083ScaelMerge files.
9843083ScaelStandard output is formatted so
9943083Scaelthe
10043083Scael.Nm pr
10143083Scaelutility writes one line from each file
10243083Scaelspecified by a file operand, side by side
10343083Scaelinto text columns of equal fixed widths, in
10443083Scaelterms of the number of column positions.
10543083Scael.Tp Cx Fl s
10643083Scael.Ar char
10743083Scael.Cx
10843083ScaelSeparate text columns by the single character
10943083Scaelchar instead of by the appropriate number of
11043083Scael<space>s (default for char is the <tab> character).
11143083Scael.Tp Fl t
11243083ScaelPrint neither the five-line identifying
11343083Scaelheader nor the five-line trailer usually
11443083Scaelsupplied for each page.
11543083ScaelQuit printing after the
11643083Scaellast line of each file without spacing to the
11743083Scaelend of the page.
11843083Scael.Tp Cx Fl w
11943083Scael.Ar width
12043083Scael.Cx
12143083ScaelSet the width of the line to width column
12243083Scaelpositions for multiple text-column output
12343083Scaelonly (default is 72).
12443083Scael.Tp
12543083Scael.Pp
12643083ScaelThe following operands are available:
12743083Scael.Tw Fl
12843083Scael.Tp Ar file
12943083ScaelA pathname of a file to be printed.
13043083Scael.Tp
13143083Scael.Pp
13243083ScaelIf no file
133*44957Scaeloperands are specified, or if a file operand is
134*44957Scael.Sq Fl ,
13543083Scaelthe standard input is used.
13643083Scael.Pp
13743083ScaelThe standard input is used only if no file operands are
138*44957Scaelspecified, or if a file operand is
139*44957Scael.Sq Fl .
14043083Scael.Pp
14143083ScaelIf pr receives an interrupt while printing to a terminal, it
14243083Scaelflushes all accumulated error messages to the screen before
14343083Scaelterminating.
14443083Scael.Pp
14543083ScaelThe pr utility output is a paginated version of the original
14643083Scaelfile (or files).
14743083ScaelThis pagination is optionally done using
14843083Scael<form-feed>s or a sequence of <newline>s.
14943083ScaelPage headers are
150*44957Scaelgenerated unless the
151*44957Scael.Fl t
152*44957Scaeloption is specified.
15343083Scael.Pp
15443083ScaelThe
15543083Scael.Nm pr
15643083Scaelutility exits 0 on success, and >0 if an error occurs.
15743083Scael.Pp
15843083ScaelError
15943083Scaelmessages are written to standard error during the printing
16043083Scaelprocess (if output is redirected) or after all successful
16143083Scaelfile printing is complete (when printing to a terminal).
162*44957Scael.Sh SEE ALSO
163*44957Scael.Xr more 1
16443083Scael.Sh STANDARDS
16543083ScaelThe
16643083Scael.Nm pr
16743083Scaelfunction is expected to be POSIX 1003.2 compatible.
168