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