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