Sun Sep 1 18:31:37 2019 UTC ()
Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf


(sevan)
diff -r1.23 -r1.24 src/usr.bin/pr/pr.1

cvs diff -r1.23 -r1.24 src/usr.bin/pr/pr.1 (switch to unified diff)

--- src/usr.bin/pr/pr.1 2017/07/03 21:34:21 1.23
+++ src/usr.bin/pr/pr.1 2019/09/01 18:31:37 1.24
@@ -1,361 +1,366 @@ @@ -1,361 +1,366 @@
1.\" $NetBSD: pr.1,v 1.23 2017/07/03 21:34:21 wiz Exp $ 1.\" $NetBSD: pr.1,v 1.24 2019/09/01 18:31:37 sevan Exp $
2.\" 2.\"
3.\" Copyright (c) 1991 Keith Muller. 3.\" Copyright (c) 1991 Keith Muller.
4.\" Copyright (c) 1993 4.\" Copyright (c) 1993
5.\" The Regents of the University of California. All rights reserved. 5.\" The Regents of the University of California. All rights reserved.
6.\" Copyright (c) 1994-1995, 1997, 1999-2003, 2009, 2012 6.\" Copyright (c) 1994-1995, 1997, 1999-2003, 2009, 2012
7.\" The NetBSD Foundation, Inc. 7.\" The NetBSD Foundation, Inc.
8.\" 8.\"
9.\" This code is derived from software contributed to Berkeley by 9.\" This code is derived from software contributed to Berkeley by
10.\" Keith Muller of the University of California, San Diego. 10.\" Keith Muller of the University of California, San Diego.
11.\" 11.\"
12.\" Redistribution and use in source and binary forms, with or without 12.\" Redistribution and use in source and binary forms, with or without
13.\" modification, are permitted provided that the following conditions 13.\" modification, are permitted provided that the following conditions
14.\" are met: 14.\" are met:
15.\" 1. Redistributions of source code must retain the above copyright 15.\" 1. Redistributions of source code must retain the above copyright
16.\" notice, this list of conditions and the following disclaimer. 16.\" notice, this list of conditions and the following disclaimer.
17.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" 2. Redistributions in binary form must reproduce the above copyright
18.\" notice, this list of conditions and the following disclaimer in the 18.\" notice, this list of conditions and the following disclaimer in the
19.\" documentation and/or other materials provided with the distribution. 19.\" documentation and/or other materials provided with the distribution.
20.\" 3. Neither the name of the University nor the names of its contributors 20.\" 3. Neither the name of the University nor the names of its contributors
21.\" may be used to endorse or promote products derived from this software 21.\" may be used to endorse or promote products derived from this software
22.\" without specific prior written permission. 22.\" without specific prior written permission.
23.\" 23.\"
24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" from: @(#)pr.1 8.1 (Berkeley) 6/6/93 36.\" from: @(#)pr.1 8.1 (Berkeley) 6/6/93
37.\" 37.\"
38.Dd July 31, 2012 38.Dd September 1, 2019
39.Dt PR 1 39.Dt PR 1
40.Os 40.Os
41.Sh NAME 41.Sh NAME
42.Nm pr 42.Nm pr
43.Nd print files 43.Nd print files
44.Sh SYNOPSIS 44.Sh SYNOPSIS
45.Nm 45.Nm
46.Op Ar \&+page 46.Op Ar \&+page
47.Op Fl Ar column 47.Op Fl Ar column
48.Op Fl adFfmprt 48.Op Fl adFfmprt
49.Oo 49.Oo
50.Fl e Ns Oo Ar char Oc Ns Op Ar gap 50.Fl e Ns Oo Ar char Oc Ns Op Ar gap
51.Oc 51.Oc
52.Op Fl h Ar header 52.Op Fl h Ar header
53.Oo 53.Oo
54.Fl i Ns Oo Ar char Oc Ns Op Ar gap 54.Fl i Ns Oo Ar char Oc Ns Op Ar gap
55.Oc 55.Oc
56.Op Fl l Ar lines 56.Op Fl l Ar lines
57.Oo 57.Oo
58.Fl n Ns Oo Ar char Oc Ns Op Ar width 58.Fl n Ns Oo Ar char Oc Ns Op Ar width
59.Oc 59.Oc
60.Op Fl o Ar offset 60.Op Fl o Ar offset
61.Oo 61.Oo
62.Fl s Ns Op Ar char 62.Fl s Ns Op Ar char
63.Oc 63.Oc
64.Op Fl T Ar timefmt 64.Op Fl T Ar timefmt
65.Op Fl w Ar width 65.Op Fl w Ar width
66.Op - 66.Op -
67.Op Ar file ... 67.Op Ar file ...
68.Sh DESCRIPTION 68.Sh DESCRIPTION
69The 69The
70.Nm 70.Nm
71utility is a printing and pagination filter for text files. 71utility is a printing and pagination filter for text files.
72When multiple input files are specified, each is read, formatted, 72When multiple input files are specified, each is read, formatted,
73and written to standard output. 73and written to standard output.
74By default, the input is separated into 66-line pages, each with 74By default, the input is separated into 66-line pages, each with
75.Bl -bullet 75.Bl -bullet
76.It 76.It
77A 5-line header with the page number, date, time, and 77A 5-line header with the page number, date, time, and
78the pathname of the file. 78the pathname of the file.
79.It 79.It
80A 5-line trailer consisting of blank lines. 80A 5-line trailer consisting of blank lines.
81.El 81.El
82.Pp 82.Pp
83If standard output is associated with a terminal, 83If standard output is associated with a terminal,
84diagnostic messages are suppressed until the 84diagnostic messages are suppressed until the
85.Nm 85.Nm
86utility has completed processing. 86utility has completed processing.
87.Pp 87.Pp
88When multiple column output is specified, 88When multiple column output is specified,
89text columns are of equal width. 89text columns are of equal width.
90By default text columns are separated by at least one 90By default text columns are separated by at least one
91.Aq Em blank . 91.Aq Em blank .
92Input lines that do not fit into a text column are truncated. 92Input lines that do not fit into a text column are truncated.
93Lines are not truncated under single column output. 93Lines are not truncated under single column output.
94.Sh OPTIONS 94.Sh OPTIONS
95In the following option descriptions, column, lines, offset, page, and 95In the following option descriptions, column, lines, offset, page, and
96width are positive decimal integers and gap is a nonnegative decimal integer. 96width are positive decimal integers and gap is a nonnegative decimal integer.
97.Bl -tag -width 4n 97.Bl -tag -width 4n
98.It Ar \&+page 98.It Ar \&+page
99Begin output at page number 99Begin output at page number
100.Ar page 100.Ar page
101of the formatted input. 101of the formatted input.
102.It Fl Ar column 102.It Fl Ar column
103Produce output that is 103Produce output that is
104.Ar columns 104.Ar columns
105wide (default is 1) that is written vertically 105wide (default is 1) that is written vertically
106down each column in the order in which the text 106down each column in the order in which the text
107is received from the input file. 107is received from the input file.
108The options 108The options
109.Fl e 109.Fl e
110and 110and
111.Fl i 111.Fl i
112are assumed. 112are assumed.
113This option should not be used with 113This option should not be used with
114.Fl m . 114.Fl m .
115When used with 115When used with
116.Fl t , 116.Fl t ,
117the minimum number of lines is used to display the output. 117the minimum number of lines is used to display the output.
118.It Fl a 118.It Fl a
119Modify the effect of the 119Modify the effect of the
120.Fl column 120.Fl column
121option so that the columns are filled across the page in a round-robin order 121option so that the columns are filled across the page in a round-robin order
122(e.g., when column is 2, the first input line heads column 122(e.g., when column is 2, the first input line heads column
1231, the second heads column 2, the third is the second line 1231, the second heads column 2, the third is the second line
124in column 1, etc.). 124in column 1, etc.).
125This option requires the use of the 125This option requires the use of the
126.Fl column 126.Fl column
127option. 127option.
128.It Fl d 128.It Fl d
129Produce output that is double spaced. 129Produce output that is double spaced.
130An extra 130An extra
131.Aq Em newline 131.Aq Em newline
132character is output following every 132character is output following every
133.Aq newline 133.Aq newline
134found in the input. 134found in the input.
135.It Fl e Ns Oo Ar char Oc Ns Op Ar gap 135.It Fl e Ns Oo Ar char Oc Ns Op Ar gap
136Expand each input 136Expand each input
137.Aq tab 137.Aq tab
138to the next greater column 138to the next greater column
139position specified by the formula 139position specified by the formula
140.Ar n*gap+1 , 140.Ar n*gap+1 ,
141where 141where
142.Em n 142.Em n
143is an integer > 0. 143is an integer > 0.
144If 144If
145.Ar gap 145.Ar gap
146is zero or is omitted the default is 8. 146is zero or is omitted the default is 8.
147All 147All
148.Aq Em tab 148.Aq Em tab
149characters in the input are expanded into the appropriate 149characters in the input are expanded into the appropriate
150number of 150number of
151.Ao Em space Ac Ns s . 151.Ao Em space Ac Ns s .
152If any nondigit character, 152If any nondigit character,
153.Ar char , 153.Ar char ,
154is specified, it is used as the input tab character. 154is specified, it is used as the input tab character.
155If the first character of 155If the first character of
156.Ar char 156.Ar char
157is a digit then 157is a digit then
158.Ar char 158.Ar char
159is treated as 159is treated as
160.Ar gap . 160.Ar gap .
161.It Fl F 161.It Fl F
162Use a 162Use a
163.Aq Em form-feed 163.Aq Em form-feed
164character for new pages, 164character for new pages,
165instead of the default behavior that uses a 165instead of the default behavior that uses a
166sequence of 166sequence of
167.Aq Em newline 167.Aq Em newline
168characters. 168characters.
169.It Fl f 169.It Fl f
170Same as 170Same as
171.Fl F . 171.Fl F .
172Additionally pause before beginning the first page 172Additionally pause before beginning the first page
173if the standard output is associated with a terminal. 173if the standard output is associated with a terminal.
174.It Fl h Ar header 174.It Fl h Ar header
175Use the string 175Use the string
176.Ar header 176.Ar header
177to replace the 177to replace the
178.Ar file name 178.Ar file name
179in the header line. 179in the header line.
180.It Fl i Ns Oo Ar char Oc Ns Op Ar gap 180.It Fl i Ns Oo Ar char Oc Ns Op Ar gap
181In output, replace multiple 181In output, replace multiple
182.Ao space Ac Ns s 182.Ao space Ac Ns s
183with 183with
184.Ao tab Ac Ns s 184.Ao tab Ac Ns s
185whenever two or more 185whenever two or more
186adjacent 186adjacent
187.Ao space Ac Ns s 187.Ao space Ac Ns s
188reach column positions 188reach column positions
189.Ar gap+1 , 189.Ar gap+1 ,
190.Ar 2*gap+1 , 190.Ar 2*gap+1 ,
191etc. 191etc.
192If 192If
193.Ar gap 193.Ar gap
194is zero or omitted, default 194is zero or omitted, default
195.Aq Em tab 195.Aq Em tab
196settings at every eighth column position 196settings at every eighth column position
197is used. 197is used.
198If any nondigit character, 198If any nondigit character,
199.Ar char , 199.Ar char ,
200is specified, it is used as the output 200is specified, it is used as the output
201.Aq Em tab 201.Aq Em tab
202character. 202character.
203If the first character of 203If the first character of
204.Ar char 204.Ar char
205is a digit then 205is a digit then
206.Ar char 206.Ar char
207is treated as 207is treated as
208.Ar gap . 208.Ar gap .
209.It Fl l Ar lines 209.It Fl l Ar lines
210Override the 66 line default and reset the page length to 210Override the 66 line default and reset the page length to
211.Ar lines . 211.Ar lines .
212If 212If
213.Ar lines 213.Ar lines
214is not greater than the sum of both the header and trailer 214is not greater than the sum of both the header and trailer
215depths (in lines), the 215depths (in lines), the
216.Nm 216.Nm
217utility suppresses output of both the header and trailer, as if the 217utility suppresses output of both the header and trailer, as if the
218.Fl t 218.Fl t
219option were in effect. 219option were in effect.
220.It Fl m 220.It Fl m
221Merge the contents of multiple files. 221Merge the contents of multiple files.
222One line from each file specified by a file operand is 222One line from each file specified by a file operand is
223written side by side into text columns of equal fixed widths, in 223written side by side into text columns of equal fixed widths, in
224terms of the number of column positions. 224terms of the number of column positions.
225The number of text columns depends on the number of 225The number of text columns depends on the number of
226file operands successfully opened. 226file operands successfully opened.
227The maximum number of files merged depends on page width and the 227The maximum number of files merged depends on page width and the
228per process open file limit. 228per process open file limit.
229The options 229The options
230.Fl e 230.Fl e
231and 231and
232.Fl i 232.Fl i
233are assumed. 233are assumed.
234.It Fl n Ns Oo Ar char Oc Ns Op Ar width 234.It Fl n Ns Oo Ar char Oc Ns Op Ar width
235Provide 235Provide
236.Ar width 236.Ar width
237digit line numbering. 237digit line numbering.
238The default for 238The default for
239.Ar width , 239.Ar width ,
240if not specified, is 5. 240if not specified, is 5.
241The number occupies the first 241The number occupies the first
242.Ar width 242.Ar width
243column positions of each text column or each line of 243column positions of each text column or each line of
244.Fl m 244.Fl m
245output. 245output.
246If 246If
247.Ar char 247.Ar char
248(any nondigit character) is given, it is appended to the line number to 248(any nondigit character) is given, it is appended to the line number to
249separate it from whatever follows. 249separate it from whatever follows.
250The default for 250The default for
251.Ar char 251.Ar char
252is a 252is a
253.Aq Em tab . 253.Aq Em tab .
254Line numbers longer than 254Line numbers longer than
255.Ar width 255.Ar width
256columns are truncated. 256columns are truncated.
257.It Fl o Ar offset 257.It Fl o Ar offset
258Each line of output is preceded by 258Each line of output is preceded by
259.Ar offset 259.Ar offset
260.Ao Em space Ac Ns s . 260.Ao Em space Ac Ns s .
261If the 261If the
262.Fl o 262.Fl o
263option is not specified, the default is zero. 263option is not specified, the default is zero.
264The space taken is in addition to the output line width. 264The space taken is in addition to the output line width.
265.It Fl p 265.It Fl p
266Pause before beginning each page if the 266Pause before beginning each page if the
267standard output is associated with a terminal. 267standard output is associated with a terminal.
268.Nm 268.Nm
269will write an 269will write an
270.Aq Em alert 270.Aq Em alert
271to standard error and wait for a 271to standard error and wait for a
272.Aq Em carriage-return 272.Aq Em carriage-return
273to be read on 273to be read on
274.Pa /dev/tty . 274.Pa /dev/tty .
275.It Fl r 275.It Fl r
276Write no diagnostic reports on failure to open a file. 276Write no diagnostic reports on failure to open a file.
277.It Fl s Ns Op Ar char 277.It Fl s Ns Op Ar char
278Separate text columns by the single character 278Separate text columns by the single character
279.Ar char 279.Ar char
280instead of by the appropriate number of 280instead of by the appropriate number of
281.Ao Em space Ac Ns s 281.Ao Em space Ac Ns s
282(default for 282(default for
283.Ar char 283.Ar char
284is the 284is the
285.Aq Em tab 285.Aq Em tab
286character). 286character).
287.It Fl T 287.It Fl T
288Specify an 288Specify an
289.Xr strftime 3 289.Xr strftime 3
290format string to be used to format the date and time information in the page 290format string to be used to format the date and time information in the page
291header. 291header.
292.It Fl t 292.It Fl t
293Print neither the five-line identifying 293Print neither the five-line identifying
294header nor the five-line trailer usually supplied for each page. 294header nor the five-line trailer usually supplied for each page.
295Quit printing after the last line of each file without spacing to the 295Quit printing after the last line of each file without spacing to the
296end of the page. 296end of the page.
297.It Fl w Ar width 297.It Fl w Ar width
298Set the width of the line to 298Set the width of the line to
299.Ar width 299.Ar width
300column positions for multiple text-column output only. 300column positions for multiple text-column output only.
301If the 301If the
302.Fl w 302.Fl w
303option is not specified and the 303option is not specified and the
304.Fl s 304.Fl s
305option is not specified, the default width is 72. 305option is not specified, the default width is 72.
306If the 306If the
307.Fl w 307.Fl w
308option is not specified and the 308option is not specified and the
309.Fl s 309.Fl s
310option is specified, the default width is 512. 310option is specified, the default width is 512.
311.It Ar file 311.It Ar file
312A pathname of a file to be printed. 312A pathname of a file to be printed.
313If no 313If no
314.Ar file 314.Ar file
315operands are specified, or if a 315operands are specified, or if a
316.Ar file 316.Ar file
317operand is 317operand is
318.Sq Fl , 318.Sq Fl ,
319the standard input is used. 319the standard input is used.
320The standard input is used only if no 320The standard input is used only if no
321.Ar file 321.Ar file
322operands are specified, or if a 322operands are specified, or if a
323.Ar file 323.Ar file
324operand is 324operand is
325.Sq Fl . 325.Sq Fl .
326.El 326.El
327.Pp 327.Pp
328The 328The
329.Fl s 329.Fl s
330option does not allow the option letter to be separated from its 330option does not allow the option letter to be separated from its
331argument, and the options 331argument, and the options
332.Fl e , 332.Fl e ,
333.Fl i , 333.Fl i ,
334and 334and
335.Fl n 335.Fl n
336require that both arguments, if present, not be separated from the option 336require that both arguments, if present, not be separated from the option
337letter. 337letter.
338.Sh ERRORS 338.Sh ERRORS
339If 339If
340.Nm 340.Nm
341receives an interrupt while printing to a terminal, it 341receives an interrupt while printing to a terminal, it
342flushes all accumulated error messages to the screen before 342flushes all accumulated error messages to the screen before
343terminating. 343terminating.
344.Pp 344.Pp
345The 345The
346.Nm 346.Nm
347utility exits 0 on success, and 1 if an error occurs. 347utility exits 0 on success, and 1 if an error occurs.
348.Pp 348.Pp
349Error messages are written to standard error during the printing 349Error messages are written to standard error during the printing
350process (if output is redirected) or after all successful 350process (if output is redirected) or after all successful
351file printing is complete (when printing to a terminal). 351file printing is complete (when printing to a terminal).
352.Sh SEE ALSO 352.Sh SEE ALSO
353.Xr cat 1 , 353.Xr cat 1 ,
354.Xr more 1 , 354.Xr more 1 ,
355.Xr strftime 3 355.Xr strftime 3
356.Sh STANDARDS 356.Sh STANDARDS
357The 357The
358.Nm 358.Nm
359utility is 359utility is
360.St -p1003.1-2008 360.St -p1003.1-2008
361compatible. 361compatible.
 362.Sh HISTORY
 363A
 364.Nm
 365utility appeared in
 366.At v1 .