xref: /freebsd/usr.bin/pr/pr.1 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
19b50d902SRodney W. Grimes.\" Copyright (c) 1991 Keith Muller.
29b50d902SRodney W. Grimes.\" Copyright (c) 1993
39b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
49b50d902SRodney W. Grimes.\"
59b50d902SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
69b50d902SRodney W. Grimes.\" Keith Muller of the University of California, San Diego.
79b50d902SRodney W. Grimes.\"
89b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
99b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
109b50d902SRodney W. Grimes.\" are met:
119b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
129b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
139b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
149b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
159b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
16*dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors
179b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
189b50d902SRodney W. Grimes.\"    without specific prior written permission.
199b50d902SRodney W. Grimes.\"
209b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
219b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
229b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
239b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
249b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
259b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
269b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
279b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
289b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
299b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
309b50d902SRodney W. Grimes.\" SUCH DAMAGE.
319b50d902SRodney W. Grimes.\"
324f45d811STim J. Robbins.Dd July 3, 2004
339b50d902SRodney W. Grimes.Dt PR 1
3462500372SRuslan Ermilov.Os
359b50d902SRodney W. Grimes.Sh NAME
369b50d902SRodney W. Grimes.Nm pr
379b50d902SRodney W. Grimes.Nd print files
389b50d902SRodney W. Grimes.Sh SYNOPSIS
39b637dfa8SPhilippe Charnier.Nm
409b50d902SRodney W. Grimes.Bk -words
419b50d902SRodney W. Grimes.Op Ar \&+page
429b50d902SRodney W. Grimes.Ek
439b50d902SRodney W. Grimes.Bk -words
449b50d902SRodney W. Grimes.Op Fl Ar column
459b50d902SRodney W. Grimes.Ek
46032b32adSJuli Mallett.Op Fl adFfmprt
479b50d902SRodney W. Grimes.Bk -words
489b50d902SRodney W. Grimes.Oo
499b50d902SRodney W. Grimes.Op Fl e
509b50d902SRodney W. Grimes.Op Ar char
519b50d902SRodney W. Grimes.Op Ar gap
529b50d902SRodney W. Grimes.Oc
539b50d902SRodney W. Grimes.Ek
549b50d902SRodney W. Grimes.Bk -words
554bf9895eSAndrey A. Chernov.Op Fl L Ar locale
564bf9895eSAndrey A. Chernov.Ek
574bf9895eSAndrey A. Chernov.Bk -words
589b50d902SRodney W. Grimes.Op Fl h Ar header
599b50d902SRodney W. Grimes.Ek
609b50d902SRodney W. Grimes.Bk -words
619b50d902SRodney W. Grimes.Oo
629b50d902SRodney W. Grimes.Op Fl i
639b50d902SRodney W. Grimes.Op Ar char
649b50d902SRodney W. Grimes.Op Ar gap
659b50d902SRodney W. Grimes.Oc
669b50d902SRodney W. Grimes.Ek
679b50d902SRodney W. Grimes.Bk -words
689b50d902SRodney W. Grimes.Op Fl l Ar lines
699b50d902SRodney W. Grimes.Ek
709b50d902SRodney W. Grimes.Bk -words
719b50d902SRodney W. Grimes.Op Fl o Ar offset
729b50d902SRodney W. Grimes.Ek
739b50d902SRodney W. Grimes.Bk -words
749b50d902SRodney W. Grimes.Oo
759b50d902SRodney W. Grimes.Op Fl s
769b50d902SRodney W. Grimes.Op Ar char
779b50d902SRodney W. Grimes.Oc
789b50d902SRodney W. Grimes.Ek
799b50d902SRodney W. Grimes.Bk -words
809b50d902SRodney W. Grimes.Oo
819b50d902SRodney W. Grimes.Op Fl n
829b50d902SRodney W. Grimes.Op Ar char
839b50d902SRodney W. Grimes.Op Ar width
849b50d902SRodney W. Grimes.Oc
859b50d902SRodney W. Grimes.Ek
869b50d902SRodney W. Grimes.Bk -words
879b50d902SRodney W. Grimes.Op Fl w Ar width
889b50d902SRodney W. Grimes.Ek
899b50d902SRodney W. Grimes.Op -
9047dec781SRuslan Ermilov.Op Ar
919b50d902SRodney W. Grimes.Sh DESCRIPTION
929b50d902SRodney W. GrimesThe
93b637dfa8SPhilippe Charnier.Nm
949b50d902SRodney W. Grimesutility is a printing and pagination filter for text files.
959b50d902SRodney W. GrimesWhen multiple input files are specified, each is read, formatted,
969b50d902SRodney W. Grimesand written to standard output.
979b50d902SRodney W. GrimesBy default, the input is separated into 66-line pages, each with
98726b61abSRuslan Ermilov.Bl -bullet
99726b61abSRuslan Ermilov.It
100726b61abSRuslan ErmilovA 5-line header with the page number, date, time, and
1019b50d902SRodney W. Grimesthe pathname of the file.
102726b61abSRuslan Ermilov.It
103726b61abSRuslan ErmilovA 5-line trailer consisting of blank lines.
104726b61abSRuslan Ermilov.El
1059b50d902SRodney W. Grimes.Pp
1069b50d902SRodney W. GrimesIf standard output is associated with a terminal,
1079b50d902SRodney W. Grimesdiagnostic messages are suppressed until the
108b637dfa8SPhilippe Charnier.Nm
1099b50d902SRodney W. Grimesutility has completed processing.
1109b50d902SRodney W. Grimes.Pp
1119b50d902SRodney W. GrimesWhen multiple column output is specified,
1129b50d902SRodney W. Grimestext columns are of equal width.
1139b50d902SRodney W. GrimesBy default text columns are separated by at least one
1149b50d902SRodney W. Grimes.Em <blank> .
1159b50d902SRodney W. GrimesInput lines that do not fit into a text column are truncated.
1169b50d902SRodney W. GrimesLines are not truncated under single column output.
1179b50d902SRodney W. Grimes.Sh OPTIONS
1189b50d902SRodney W. GrimesIn the following option descriptions, column, lines, offset, page, and
1199b50d902SRodney W. Grimeswidth are positive decimal integers and gap is a nonnegative decimal integer.
1209b50d902SRodney W. Grimes.Bl -tag -width 4n
1219b50d902SRodney W. Grimes.It Ar \&+page
1229b50d902SRodney W. GrimesBegin output at page number
1239b50d902SRodney W. Grimes.Ar page
1249b50d902SRodney W. Grimesof the formatted input.
1259b50d902SRodney W. Grimes.It Fl Ar column
1269b50d902SRodney W. GrimesProduce output that is
1279b50d902SRodney W. Grimes.Ar columns
1289b50d902SRodney W. Grimeswide (default is 1) that is written vertically
1299b50d902SRodney W. Grimesdown each column in the order in which the text
1309b50d902SRodney W. Grimesis received from the input file.
1319b50d902SRodney W. GrimesThe options
1329b50d902SRodney W. Grimes.Fl e
1339b50d902SRodney W. Grimesand
1349b50d902SRodney W. Grimes.Fl i
1359b50d902SRodney W. Grimesare assumed.
1369b50d902SRodney W. GrimesThis option should not be used with
1379b50d902SRodney W. Grimes.Fl m .
1389b50d902SRodney W. GrimesWhen used with
1399b50d902SRodney W. Grimes.Fl t ,
1409b50d902SRodney W. Grimesthe minimum number of lines is used to display the output.
141bc14f117SGarrett Wollman(To columnify and reshape text files more generally and without additional
142bc14f117SGarrett Wollmanformatting, see the
143bc14f117SGarrett Wollman.Xr rs 1
144bc14f117SGarrett Wollmanutility.)
1459b50d902SRodney W. Grimes.It Fl a
1469b50d902SRodney W. GrimesModify the effect of the
1479b50d902SRodney W. Grimes.Fl column
1489b50d902SRodney W. Grimesoption so that the columns are filled across the page in a round-robin order
1499b50d902SRodney W. Grimes(e.g., when column is 2, the first input line heads column
1509b50d902SRodney W. Grimes1, the second heads column 2, the third is the second line
1519b50d902SRodney W. Grimesin column 1, etc.).
1529b50d902SRodney W. GrimesThis option requires the use of the
1539b50d902SRodney W. Grimes.Fl column
1549b50d902SRodney W. Grimesoption.
1559b50d902SRodney W. Grimes.It Fl d
15687faa07bSSheldon HearnProduce output that is double spaced.
15787faa07bSSheldon HearnAn extra
1589b50d902SRodney W. Grimes.Em <newline>
159b637dfa8SPhilippe Charniercharacter is output following every
160b637dfa8SPhilippe Charnier.Em <newline>
161b637dfa8SPhilippe Charnierfound in the input.
162d0353b83SRuslan Ermilov.It Fl e Xo
163d0353b83SRuslan Ermilov.Op Ar char Ns
164d0353b83SRuslan Ermilov.Op Ar gap
165d0353b83SRuslan Ermilov.Xc
166b637dfa8SPhilippe CharnierExpand each input
167b637dfa8SPhilippe Charnier.Em <tab>
168b637dfa8SPhilippe Charnierto the next greater column
1699b50d902SRodney W. Grimesposition specified by the formula
1709b50d902SRodney W. Grimes.Ar n*gap+1 ,
1719b50d902SRodney W. Grimeswhere
1729b50d902SRodney W. Grimes.Em n
1739b50d902SRodney W. Grimesis an integer > 0.
1749b50d902SRodney W. GrimesIf
1759b50d902SRodney W. Grimes.Ar gap
1769b50d902SRodney W. Grimesis zero or is omitted the default is 8.
1779b50d902SRodney W. GrimesAll
1789b50d902SRodney W. Grimes.Em <tab>
1799b50d902SRodney W. Grimescharacters in the input are expanded into the appropriate
1809b50d902SRodney W. Grimesnumber of
1819b50d902SRodney W. Grimes.Em <space>s .
1829b50d902SRodney W. GrimesIf any nondigit character,
1839b50d902SRodney W. Grimes.Ar char ,
1849b50d902SRodney W. Grimesis specified, it is used as the input tab character.
1859b50d902SRodney W. Grimes.It Fl F
1869b50d902SRodney W. GrimesUse a
1879b50d902SRodney W. Grimes.Em <form-feed>
1889b50d902SRodney W. Grimescharacter for new pages,
1899b50d902SRodney W. Grimesinstead of the default behavior that uses a
190b637dfa8SPhilippe Charniersequence of
1919b50d902SRodney W. Grimes.Em <newline>
1929b50d902SRodney W. Grimescharacters.
193032b32adSJuli Mallett.It Fl f
194032b32adSJuli MallettSame as
195032b32adSJuli Mallett.Fl F
196032b32adSJuli Mallettbut pause before beginning the first page if standard output is a terminal.
1979b50d902SRodney W. Grimes.It Fl h Ar header
1989b50d902SRodney W. GrimesUse the string
1999b50d902SRodney W. Grimes.Ar header
2009b50d902SRodney W. Grimesto replace the
2019b50d902SRodney W. Grimes.Ar file name
2029b50d902SRodney W. Grimesin the header line.
203d0353b83SRuslan Ermilov.It Fl i Xo
204d0353b83SRuslan Ermilov.Op Ar char Ns
205d0353b83SRuslan Ermilov.Op Ar gap
206d0353b83SRuslan Ermilov.Xc
207b637dfa8SPhilippe CharnierIn output, replace multiple
208b637dfa8SPhilippe Charnier.Em <space>s
209b637dfa8SPhilippe Charnierwith
210b637dfa8SPhilippe Charnier.Em <tab>s
211b637dfa8SPhilippe Charnierwhenever two or more
212b637dfa8SPhilippe Charnieradjacent
213b637dfa8SPhilippe Charnier.Em <space>s
214b637dfa8SPhilippe Charnierreach column positions
2159b50d902SRodney W. Grimes.Ar gap+1 ,
2169b50d902SRodney W. Grimes.Ar 2*gap+1 ,
2179b50d902SRodney W. Grimesetc.
2189b50d902SRodney W. GrimesIf
2199b50d902SRodney W. Grimes.Ar gap
2209b50d902SRodney W. Grimesis zero or omitted, default
2219b50d902SRodney W. Grimes.Em <tab>
2229b50d902SRodney W. Grimessettings at every eighth column position
2239b50d902SRodney W. Grimesis used.
2249b50d902SRodney W. GrimesIf any nondigit character,
2259b50d902SRodney W. Grimes.Ar char ,
2269b50d902SRodney W. Grimesis specified, it is used as the output
2279b50d902SRodney W. Grimes.Em <tab>
2289b50d902SRodney W. Grimescharacter.
2294bf9895eSAndrey A. Chernov.It Fl L Ar locale
2304bf9895eSAndrey A. ChernovUse
2314bf9895eSAndrey A. Chernov.Ar locale
2324bf9895eSAndrey A. Chernovspecified as argument instead of one found in environment.
2334bf9895eSAndrey A. ChernovUse "C" to reset locale to default.
2349b50d902SRodney W. Grimes.It Fl l Ar lines
2359b50d902SRodney W. GrimesOverride the 66 line default and reset the page length to
2369b50d902SRodney W. Grimes.Ar lines .
2379b50d902SRodney W. GrimesIf
2389b50d902SRodney W. Grimes.Ar lines
2399b50d902SRodney W. Grimesis not greater than the sum of both the header and trailer
2409b50d902SRodney W. Grimesdepths (in lines), the
241b637dfa8SPhilippe Charnier.Nm
2429b50d902SRodney W. Grimesutility suppresses output of both the header and trailer, as if the
2439b50d902SRodney W. Grimes.Fl t
2449b50d902SRodney W. Grimesoption were in effect.
2459b50d902SRodney W. Grimes.It Fl m
2469b50d902SRodney W. GrimesMerge the contents of multiple files.
2479b50d902SRodney W. GrimesOne line from each file specified by a file operand is
2489b50d902SRodney W. Grimeswritten side by side into text columns of equal fixed widths, in
2499b50d902SRodney W. Grimesterms of the number of column positions.
2509b50d902SRodney W. GrimesThe number of text columns depends on the number of
2519b50d902SRodney W. Grimesfile operands successfully opened.
2529b50d902SRodney W. GrimesThe maximum number of files merged depends on page width and the
2539b50d902SRodney W. Grimesper process open file limit.
2549b50d902SRodney W. GrimesThe options
2559b50d902SRodney W. Grimes.Fl e
2569b50d902SRodney W. Grimesand
2579b50d902SRodney W. Grimes.Fl i
2589b50d902SRodney W. Grimesare assumed.
259d0353b83SRuslan Ermilov.It Fl n Xo
260d0353b83SRuslan Ermilov.Op Ar char Ns
261d0353b83SRuslan Ermilov.Op Ar width
262d0353b83SRuslan Ermilov.Xc
2639b50d902SRodney W. GrimesProvide
2649b50d902SRodney W. Grimes.Ar width
2659b50d902SRodney W. Grimesdigit line numbering.
2669b50d902SRodney W. GrimesThe default for
2679b50d902SRodney W. Grimes.Ar width ,
2689b50d902SRodney W. Grimesif not specified, is 5.
2699b50d902SRodney W. GrimesThe number occupies the first
2709b50d902SRodney W. Grimes.Ar width
2719b50d902SRodney W. Grimescolumn positions of each text column or each line of
2729b50d902SRodney W. Grimes.Fl m
2739b50d902SRodney W. Grimesoutput.
2749b50d902SRodney W. GrimesIf
2759b50d902SRodney W. Grimes.Ar char
2769b50d902SRodney W. Grimes(any nondigit character) is given, it is appended to the line number to
27787faa07bSSheldon Hearnseparate it from whatever follows.
27887faa07bSSheldon HearnThe default for
2799b50d902SRodney W. Grimes.Ar char
2809b50d902SRodney W. Grimesis a
2819b50d902SRodney W. Grimes.Em <tab> .
2829b50d902SRodney W. GrimesLine numbers longer than
2839b50d902SRodney W. Grimes.Ar width
2849b50d902SRodney W. Grimescolumns are truncated.
2859b50d902SRodney W. Grimes.It Fl o Ar offset
2869b50d902SRodney W. GrimesEach line of output is preceded by
2879b50d902SRodney W. Grimes.Ar offset
2889b50d902SRodney W. Grimes.Em <spaces>s .
2899b50d902SRodney W. GrimesIf the
290d6801b5cSRuslan Ermilov.Fl o
2919b50d902SRodney W. Grimesoption is not specified, the default is zero.
2929b50d902SRodney W. GrimesThe space taken is in addition to the output line width.
293032b32adSJuli Mallett.It Fl p
294032b32adSJuli MallettPause before each page if the standard output is a terminal.
295032b32adSJuli Mallett.Nm
296032b32adSJuli Mallettwill write an alert character to standard error and wait for a carriage
297032b32adSJuli Mallettreturn to be read on the terminal.
2989b50d902SRodney W. Grimes.It Fl r
2999b50d902SRodney W. GrimesWrite no diagnostic reports on failure to open a file.
3009b50d902SRodney W. Grimes.It Fl s Ar char
3019b50d902SRodney W. GrimesSeparate text columns by the single character
3029b50d902SRodney W. Grimes.Ar char
3039b50d902SRodney W. Grimesinstead of by the appropriate number of
3049b50d902SRodney W. Grimes.Em <space>s
3059b50d902SRodney W. Grimes(default for
3069b50d902SRodney W. Grimes.Ar char
3079b50d902SRodney W. Grimesis the
3089b50d902SRodney W. Grimes.Em <tab>
3099b50d902SRodney W. Grimescharacter).
3109b50d902SRodney W. Grimes.It Fl t
3119b50d902SRodney W. GrimesPrint neither the five-line identifying
3129b50d902SRodney W. Grimesheader nor the five-line trailer usually supplied for each page.
3139b50d902SRodney W. GrimesQuit printing after the last line of each file without spacing to the
3149b50d902SRodney W. Grimesend of the page.
3159b50d902SRodney W. Grimes.It Fl w Ar width
3169b50d902SRodney W. GrimesSet the width of the line to
3179b50d902SRodney W. Grimes.Ar width
3189b50d902SRodney W. Grimescolumn positions for multiple text-column output only.
3199b50d902SRodney W. GrimesIf the
3209b50d902SRodney W. Grimes.Fl w
3219b50d902SRodney W. Grimesoption is not specified and the
3229b50d902SRodney W. Grimes.Fl s
3239b50d902SRodney W. Grimesoption is not specified, the default width is 72.
3249b50d902SRodney W. GrimesIf the
3259b50d902SRodney W. Grimes.Fl w
3269b50d902SRodney W. Grimesoption is not specified and the
3279b50d902SRodney W. Grimes.Fl s
3289b50d902SRodney W. Grimesoption is specified, the default width is 512.
3299b50d902SRodney W. Grimes.It Ar file
3309b50d902SRodney W. GrimesA pathname of a file to be printed.
3319b50d902SRodney W. GrimesIf no
3329b50d902SRodney W. Grimes.Ar file
3339b50d902SRodney W. Grimesoperands are specified, or if a
3349b50d902SRodney W. Grimes.Ar file
3359b50d902SRodney W. Grimesoperand is
3369b50d902SRodney W. Grimes.Sq Fl ,
3379b50d902SRodney W. Grimesthe standard input is used.
3389b50d902SRodney W. GrimesThe standard input is used only if no
3399b50d902SRodney W. Grimes.Ar file
3409b50d902SRodney W. Grimesoperands are specified, or if a
3419b50d902SRodney W. Grimes.Ar file
3429b50d902SRodney W. Grimesoperand is
3439b50d902SRodney W. Grimes.Sq Fl .
3449b50d902SRodney W. Grimes.El
3459b50d902SRodney W. Grimes.Pp
3469b50d902SRodney W. GrimesThe
3479b50d902SRodney W. Grimes.Fl s
3489b50d902SRodney W. Grimesoption does not allow the option letter to be separated from its
3499b50d902SRodney W. Grimesargument, and the options
3509b50d902SRodney W. Grimes.Fl e ,
3519b50d902SRodney W. Grimes.Fl i ,
3529b50d902SRodney W. Grimesand
3539b50d902SRodney W. Grimes.Fl n
3549b50d902SRodney W. Grimesrequire that both arguments, if present, not be separated from the option
3559b50d902SRodney W. Grimesletter.
356a866e170SRuslan Ermilov.Sh EXIT STATUS
357ed120cdbSEitan Adler.Ex -std
358a866e170SRuslan Ermilov.Sh DIAGNOSTICS
3596c7216dfSRuslan ErmilovIf
3606c7216dfSRuslan Ermilov.Nm
3616c7216dfSRuslan Ermilovreceives an interrupt while printing to a terminal, it
3626c7216dfSRuslan Ermilovflushes all accumulated error messages to the screen before
3636c7216dfSRuslan Ermilovterminating.
3646c7216dfSRuslan Ermilov.Pp
3659b50d902SRodney W. GrimesError messages are written to standard error during the printing
3669b50d902SRodney W. Grimesprocess (if output is redirected) or after all successful
3679b50d902SRodney W. Grimesfile printing is complete (when printing to a terminal).
3689b50d902SRodney W. Grimes.Sh SEE ALSO
3699b50d902SRodney W. Grimes.Xr cat 1 ,
370bc14f117SGarrett Wollman.Xr more 1 ,
371bc14f117SGarrett Wollman.Xr rs 1
3729b50d902SRodney W. Grimes.Sh STANDARDS
3739b50d902SRodney W. GrimesThe
374b637dfa8SPhilippe Charnier.Nm
3759b50d902SRodney W. Grimesutility is
376032b32adSJuli Mallett.St -p1003.1-2001
3779b50d902SRodney W. Grimescompatible.
378b8923d4cSWolfram Schneider.Sh HISTORY
379b8923d4cSWolfram SchneiderA
380b8923d4cSWolfram Schneider.Nm
381b8923d4cSWolfram Schneidercommand appeared in
382b8923d4cSWolfram Schneider.At v1 .
3834f45d811STim J. Robbins.Sh BUGS
3844f45d811STim J. RobbinsThe
3854f45d811STim J. Robbins.Nm
3864f45d811STim J. Robbinsutility does not recognize multibyte characters.
387