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