xref: /csrg-svn/old/pr/pr.1 (revision 43083)
1.\" Copyright (c) 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)pr.1	6.2 (Berkeley) 06/11/90
7.\"
8.Dd
9.Dt PR 1
10.Os BSD 4.4
11.Sh NAME
12.Nm pr
13.Nd Print files.
14.Sh SYNOPSIS
15.Ar pr
16.Op +page
17.Oo
18.Op Fl Ar column
19.Op Fl f
20.Op Fl hheader
21.Op Fl llines
22.Op Fl m
23.Op Fl s Ar char
24.Op Fl t
25.Op Fl w Ar width
26.Ar
27.Oo
28.Sh DESCRIPTION
29The
30.Nm pr
31utility is a printing and pagination filter.
32If multiple
33input files are specified, each is read, formatted,
34and written to standard output.
35By default, the input is
36separated into pages, each with a header that includes the
37page number, date, time, and the file's pathname.
38Text
39columns are of equal width, with at least one <blank>
40separation between text columns.
41Lines that do not fit into
42a text column are truncated.
43If standard output is associated
44with a terminal, diagnostic messages are suppressed
45until the pr utility has completed processing.
46.Pp
47The following options are available:
48.Tw Fl
49.Tp Ar +page
50Begin output at page number page of the
51formatted input.
52.Tp Ar \-column
53Produce output that is columns wide (default
54is 1) and is in text column rank order.
55This
56option should not be used with \-m.
57When
58used with \-t, use the minimum number of lines
59to display the output.
60.Tp Fl f
61Use <form-feed> character for new pages,
62instead of the default behavior that uses a
63sequence of <newline> characters.
64Prior to
65displaying the first page of output an
66<alert> character is written to standard output.
67.Tp Cx  Fl h
68.Ar header
69.Cx
70Use the string header as the header to be
71printed instead of file.
72.Tp Cx Fl l
73.Ar lines
74.Cx
75Override the 66 line default and reset the
76page length to lines.
77If lines is smaller
78than the sum of both the header and trailer
79depths (in lines), the pr utility suppresses
80both the header and trailer, as if the \-t
81option were in effect.
82.Tp Fl m
83Merge files.
84Standard output is formatted so
85the
86.Nm pr
87utility writes one line from each file
88specified by a file operand, side by side
89into text columns of equal fixed widths, in
90terms of the number of column positions.
91.Tp Cx Fl s
92.Ar char
93.Cx
94Separate text columns by the single character
95char instead of by the appropriate number of
96<space>s (default for char is the <tab> character).
97.Tp Fl t
98Print neither the five-line identifying
99header nor the five-line trailer usually
100supplied for each page.
101Quit printing after the
102last line of each file without spacing to the
103end of the page.
104.Tp Cx Fl w
105.Ar width
106.Cx
107Set the width of the line to width column
108positions for multiple text-column output
109only (default is 72).
110.Tp
111.Pp
112The following operands are available:
113.Tw Fl
114.Tp Ar file
115A pathname of a file to be printed.
116.Tp
117.Pp
118If no file
119operands are specified, or if a file operand is \-,
120the standard input is used.
121.Pp
122The standard input is used only if no file operands are
123specified, or if a file operand is \-.
124.Pp
125If pr receives an interrupt while printing to a terminal, it
126flushes all accumulated error messages to the screen before
127terminating.
128.Pp
129The pr utility output is a paginated version of the original
130file (or files).
131This pagination is optionally done using
132<form-feed>s or a sequence of <newline>s.
133Page headers are
134generated unless the \-t option is specified.
135.Pp
136The
137.Nm pr
138utility exits 0 on success, and >0 if an error occurs.
139.Pp
140Error
141messages are written to standard error during the printing
142process (if output is redirected) or after all successful
143file printing is complete (when printing to a terminal).
144.Sh FILES
145.Sh STANDARDS
146The
147.Nm pr
148function is expected to be POSIX 1003.2 compatible.
149