|PR(1)||General Commands Manual||PR(1)|
pr — print
pr utility is a printing and
pagination filter for text files. When multiple input files are specified,
each is read, formatted, and written to standard output. By default, the
input is separated into 66-line pages, each with
Optionally, the trailer can be replaced by a
<form-feed> where this is more appropriate for the
output device being used and <tab>s can be expanded
to input relative <spaces>s or
<space>s can be contracted to output relative
pr utility also
interprets <form-feed>s in the input as the logical
end of pages.
When multiple column output is specified, text columns are of equal width. By default text columns are separated by at least one <blank>. Input lines that do not fit into a text column are truncated, except in the default single columns output mode.
Error messages are written to standard error during the printing
process (if output is redirected) or after all successful file printing is
complete (when printing to a terminal). If
receives an interrupt while printing to a terminal, it flushes all
accumulated error messages to the screen before terminating.
The options are as follows:
-iare assumed. This option should not be used with
-m. When used with
-t, the minimum number of lines is used to display the output.
-column option so that the columns are filled across the page in a round-robin order (e.g., when column is 2, the first input line heads column 1, the second heads column 2, the third is the second line in column 1, etc.). This option requires the use of the
prutility suppresses output of both the header and trailer, as if the
-toption were in effect.
-moutput. If char (any nondigit character) is given, it is appended to the line number to separate it from whatever follows. The default for char is a <tab>. Line numbers longer than width columns are truncated.
-ooption is not specified, the default is zero. The space taken is in addition to the output line width.
-woption is not specified and the
-soption is not specified, the default width is 72. If the
-woption is not specified and the
-soption is specified, the default width is 512.
pr utility exits 0 on success,
and >0 if an error occurs.
pr utility is compliant with the
IEEE Std 1003.1-2008 (“POSIX.1”)
The flag [
-f] is marked by
IEEE Std 1003.1-2008 (“POSIX.1”) as
being an X/Open System Interfaces option.
IEEE Std 1003.1-2008
(“POSIX.1”) is relatively silent concerning the
handling of input characters beyond the behavior dictated by the
pr required command options.
pr command appeared in
Version 1 AT&T UNIX.
The interpretation of <form-feed>s in the input stream is that they are special <newline>s which have the side effect of causing a page break. While this works correctly for all cases, strict interpretation also implies that the common convention of placing a <form-feed> on a line by itself is actually interpreted as a blank line, page break, blank line.
is intended to paginate input containing basic
ascii(7) text formatting and input streams
or long lines may result in formatting errors.
pr utility does not
currently understand over-printing using
characters, and except in the case of unmodified single-column output, use
of these characters will cause formatting errors.
The lack of a line wrapping option, and the specification that truncation does not apply to single-column output frequently results in formatting errors when input lines are longer than actual line width of the output device.
The default width of 72 is archaic and non-obvious since it is
normally ignored in the default single column mode. Using the
-m option with one column provides a way to truncate
single column output but there's no way to wrap long lines to a fixed line
The default of <tab> for the separator for
-s options often
results in lines apparently wider than expected.
|June 4, 2014||OpenBSD-current|