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