PR(1V)

NAME
pr - format and print files

SYNOPSIS
pr [-column [-wwidth] [-a]] [-ect] [-ict] [-drtfp] [+page] [-nsk] [-ooffset] [-llength] [-sseparator] [-h header] [file ...]
pr [-m [-wwidth]] [-ect] [-ict] [-drtfp] [+page] [-nsk] [-ooffset] [-llength] [-sseperator] [-h header] file1 file2 ...

DESCRIPTION
Pr produces a printed listing of one or more files. If no files are specified or “-” is given as a file name then pr will read from the standard input. The output is separated into pages headed by the date, the name of the file or a specified header, and the page number.

A variety of options allow the output format to be changed.

OPTIONS
The basic options control how multiple files are printed:

-column
    Format each file in turn producing column column output. The default is to produce one column output.

-m  Format n files into n columns, one file per column.

If multi-column output is produced the columns default to the same width and over long lines are truncated as necessary (to give at least one space between each column), but see the description of -s below.

-a  The -a option is not allowed if -m is given. Otherwise it causes successive lines in multi-column output to go across the page rather than down. (Thus lines are written into the first line of the first column, then the first line of the second and so on, rather than using the whole of the first column on the page then the second column).

The following option affectds how multiple column output is acheived:

-scharacter
    No spacing or truncation of column lines is done; lines from adjacent columns are simply separated by a single tabulation character character. If character is not specified it defaults to the ASCII horizontal tab character.

Various options control the overall page layout:

-wwidth
    Specifies the length of a line. The default value is 72. This space is divided between the columns. The overall line width is the sum of this width and the offset specified by -o.

-ooffset
    Offset each line by offset characters.

-llength
    Set the page length to length lines. If this is less than the space required by the header and trailer they will both be switched off (see -t below).

By default a five line header containing the date, file name and page number (on line 3) and a trailer of five blank lines are output on each page.

-h header
    Use header as the page header instead of the relevant file name.

-t  Do not output either the header or trailer.

The text output can be processed in various ways:

-e[<char>][<pos>]
    Where <char> is a single non-digit character and <pos> is a decimal number specifies the tab spacing on the output. Tab stops are positioned at n*<pos>+1 for n from 1. Input tab characters are expanded into an appropriate number of spaces. <Char> is the input tab character. <Pos> defaults to 8, <char> defaults to the ASCII tab character.

-i[<char>][<pos>]
    Does the reverse operation on output - replaces spaces by tab characters <char> to tab to positions n*<pos>+1. <Pos> defaults to 8 and <char> to the ASCII tab character.

-d  Causes the output to be double spaced by inserting blank lines.

+page
    Begin output with page page.

-n[<char>][<number>]
    Number the lines with <number> digit numbers (default 5 digits). <Char> (default the ASCII tab character) is appended to the number to separate it from the rest of the line. With -column multi-column output each column has a line number. With -m multi-column output there is one line number for all columns.

Finally some options control the overall user interface.

-r  If a file cannot be opened no diagnostic messages are output. If this option is not given diagnostics will be produced after the output if it is to a terminal, otherwise at the top of the output. Diagnostics are printed on the standard error stream.

-f  Uses ASCII form feed characters to move to the head of the next page rather than outputing the appropriate number of line feed characters. If the output is to a terminal the program also pauses for a carriage return (after ringing the terminal bell) before the first page.

-p  Pause before each page if the output is to a terminal. The terminal bell is rung and pr waits for a carriage return to be typed.

SEE ALSO
cat(1), paste(1v), lp(1v), lpr(1).