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