Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cat(1V)

lpr(1)

PR(1V)  —  USER COMMANDS

NAME

pr − prepare file(s) for printing, perhaps in multiple columns

SYNOPSIS

pr [ −n ] [ +n ] [ −h string ] [ −wn ] [ −f ] [ −ln ] [ −t ] [ −sc ] [ −m ] [ file ] ...

SYSTEM V SYNOPSIS

/usr/5bin/pr [ −r ] [ −p ] [ −n ] [ +n ] [ −h string ] [ −nck ] [ −eck ] [ −ick ] [ −d ] [ −wn ]

[ −on ] [ −f ] [ −ln ] [ −t ] [ −sc ] [ −m ] [ −a ] [ file ] ...

DESCRIPTION

pr prepares one or more files for printing.  By default, the output is separated into pages headed by a date, the name of the file, and the page number. pr prints its standard input if there are no file arguments.  Formfeed characters in the input files cause page breaks in the output, as expected. 

By default, columns are of equal width, separated by at least one space; lines that do not fit are truncated.  If the −s option is used, lines are not truncated and columns are separated by the separation character. 

Inter-terminal messages via write are forbidden during a pr.

OPTIONS

Options apply to all following files but may be reset between files:

−n Produce n-column output.  For example:

Printofin
theonethree
linesfilecolumns.

Columns are not balanced; if, for example, there are as many lines in the file as there are lines on the page, only one column will be printed.  Even if the −t option (see below) is specified, blank lines will be printed at the end of the output to pad it to a full page. 

+n Begin printing with page n.

−h string Use string, instead of the file name, in the page header.

−wn For multicolumn output, take the width of the page to be n characters instead of the default 72. 

−f Use formfeeds instead of NEWLINES to separate pages.  A formfeed is assumed to use up two blank lines at the top of a page.  Thus this option does not affect the effective page length. 

−ln Take the length of the page to be n lines instead of the default 66. 

−t Do not print the 5-line header or the 5-line trailer normally supplied for each page.  Pages are not separated when this option is used, even if the −f option was used.  The −t option is intended for applications where the results should be directed to a file for further processing. 

−sc Separate columns by the single character c instead of by the appropriate amount of white space.  A missing c is taken to be a tab. 

−m Print all files simultaneously, each in one column, for example:

PrintPrintThe
thethethird
lineslinesfile’s
of oflines
filefilego
one.two.here.

SYSTEM V OPTIONS

When the −n option is specified for multicolumn output, columns are balanced; for example, if there are as many lines in the file as there are lines to be printed, and two columns are to be printed, each column will contain half the lines of the file.  If the −t option is specified, no blank lines will be printed to pad the last page. 

The options −e and −i are assumed for multicolumn output.  The −m option overrides the −k and −a options. 

The −f option does not assume that the formfeed uses up two blank lines; blank lines will be printed after the formfeed, if necessary. 

−r Print no diagnostic reports if a file can’t be opened, or if it is empty. 

−p Pause before beginning each page if the output is directed to a terminal (pr will ring the bell at the terminal and wait for a carriage return). 

−nck Provide k-digit line numbering (default for k is 5).  The number occupies the first k+1 character positions of each column of normal output or each line of −m output.  If c (any non-digit character) is given, it is appended to the line number to separate it from whatever follows (default for c is a tab). 

−eck Expand input tabs to character positions k+1, 2∗k+1, 3∗k+1, etc. If k is 0 or is omitted, default tab settings at every eighth position are assumed.  Tab characters in the input are expanded into the appropriate number of spaces.  If c (any non-digit character) is given, it is treated as the input tab character (default for c is the tab character). 

−ick In output, replace white space wherever possible by inserting tabs to character positions k+1, 2∗k+1, 3∗k+1, etc. If k is 0 or is omitted, default tab settings at every eighth position are assumed.  If c (any non-digit character) is given, it is treated as the output tab character (default for c is the tab character). 

−d Double-space the output. 

−ok Offset each line by k character positions.  The number of character positions per line is the sum of the width and offset. 

−a When combined with the −n option, print multicolumn output across the page.  For example:

Printthelines
ofonefile
inthreecolumns.

EXAMPLES

Print a file called dreadnought on the printer — this is the simplest use of pr:

tutorial% pr  dreadnought | lpr
tutorial%

Produce three laminations of a file called ridings side by side in the output, with no headers or trailers, the results to appear in the file called Yorkshire:

tutorial% pr  −m −t ridings ridings ridings > Yorkshire
tutorial%

FILES

/dev/tty∗to suspend messages. 

SEE ALSO

cat(1V), lpr(1)

DIAGNOSTICS

can’t print 0 cols, using 1 instead. 
−0 was specified as a −n option. 

pr: bad key key
An illegal option was given.

pr: No room for columns. 
The number of columns requested won’t fit on the page.

pr: Too many args
More than 10 files were specified with the −m option. 

file: error
A file could not be opened.  This diagnostic is not printed if pr is printing on a terminal. 

SYSTEM V DIAGNOSTICS

pr: bad option
An illegal option was given.

pr: width too small
The number of columns requested won’t fit on the page.

pr: too many files
More than 10 files were specified with the −m option. 

pr: page-buffer overflow
The formatting required is more complicated than pr can handle. 

pr: out of space
pr could not allocate a buffer it required. 

pr: file -- empty file
The file was empty.  This diagnostic is printed after all the files are printed if pr is printing on a terminal. 

pr: can’t open file
A file could not be opened.  This diagnostic is printed after all the files are printed if pr is printing on a terminal. 

BUGS

The options described above interact with each other in strange and as yet to be defined ways. 

Sun Release 3.2  —  Last change: 17 July 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026