pr(C)


pr -- print files on the standard output

Syntax

pr [ options ] [ files ]

Description

The pr command prints the named files on the standard output. If file is ``-'', or if no files are specified, the standard input is assumed. By default, the listing is separated into pages of 66 lines, each with a five line header that includes the page number, date and time of creation or modification, and pathname. A trailer consisting of five blank lines is also added.

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

If the standard output is associated with a terminal, error messages are withheld until pr has completed printing.

Options may appear singly or combined in any order. Their meanings are:


-a
Prints multi-column output across the page.

-d
Double-spaces the output.

-eck
Expands input tabs to character positions k+1, 2*k+1, 3*k+1, as so on. If k is 0 or is omitted, default tab settings at every 8th 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).

-f
Uses form feed character for new pages (default is to use a sequence of linefeeds). Pauses before beginning the first page if the standard output is associated with a terminal.

-F
Uses a form feed character for new pages.

-h header
Uses header as the header to be printed instead of the filename.

-ick
In output, replaces white space wherever possible by inserting tabs to character positions k+1, 2*k+1, 3*k+1, as so on. If k is 0 or is omitted, default tab settings at every 8th 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).

+k
Begins printing with page k (default is 1).

-k
Produces k-column output (default is 1). The options -e and -i are assumed for multi-column output.

-l n
Sets the length of a page to n lines (default is 66).

-m
Merges and prints all files simultaneously, one per column (overrides the -k, and -a options).

-nck
Provides 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).

-o k
Offsets each line by k character positions (default is 0). The number of character positions per line is the sum of the width and offset.

-p
Pauses 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 to be read from /dev/tty.

-r
Prints no diagnostic reports on failure to open files.

-sc
Separates columns by the single character c instead of by the appropriate number of spaces (default for c is a tab).

-t
Prints neither the 5-line identifying header nor the 5-line trailer normally supplied for each page. Quits printing after the last line of each file without spacing to the end of the page.

-w k
Sets the width of a line to k character positions (default is 72 for equal-width multi-column output, no limit otherwise). If -w is not specified, but -s is given, the default width is 512.

Examples

The following prints file1 and file2 as a double-spaced, three-column listing headed by ``file list'':

pr -3dh "file list" file1 file2

The following writes file1 on file2, expanding tabs to columns 10, 19, 28, 37... :

pr -e9 -t <file1 >file2

See also

cat(C)

Standards conformance

pr is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005