|
Packit |
7cfc04 |
'\" et
|
|
Packit |
7cfc04 |
.TH PR "1P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH PROLOG
|
|
Packit |
7cfc04 |
This manual page is part of the POSIX Programmer's Manual.
|
|
Packit |
7cfc04 |
The Linux implementation of this interface may differ (consult
|
|
Packit |
7cfc04 |
the corresponding Linux manual page for details of Linux behavior),
|
|
Packit |
7cfc04 |
or the interface may not be implemented on Linux.
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
pr
|
|
Packit |
7cfc04 |
\(em print files
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
pr \fB[\fR+\fIpage\fB] [\fR\(mi\fIcolumn\fB] [\fR\(miadFmrt\fB] [\fR\(mie\fB[\fIchar\fB][\fIgap\fB]] [\fR\(mih \fIheader\fB] [\fR\(mii\fB[\fIchar\fB][\fIgap\fB]]
|
|
Packit |
7cfc04 |
[\fR\(mil \fIlines\fB] [\fR\(min\fB[\fIchar\fB][\fIwidth\fB]] [\fR\(mio \fIoffset\fB] [\fR\(mis\fB[\fIchar\fB]] [\fR\(miw \fIwidth\fB] [\fR\(mifp\fB]
|
|
Packit |
7cfc04 |
[\fIfile\fR...\fB]\fR
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility is a printing and pagination filter. If multiple input files
|
|
Packit |
7cfc04 |
are specified, each shall be read, formatted, and written to standard
|
|
Packit |
7cfc04 |
output. By default, the input shall be separated into 66-line pages,
|
|
Packit |
7cfc04 |
each with:
|
|
Packit |
7cfc04 |
.IP " *" 4
|
|
Packit |
7cfc04 |
A 5-line header that includes the page number, date, time, and
|
|
Packit |
7cfc04 |
the pathname of the file
|
|
Packit |
7cfc04 |
.IP " *" 4
|
|
Packit |
7cfc04 |
A 5-line trailer consisting of blank lines
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If standard output is associated with a terminal, diagnostic messages
|
|
Packit |
7cfc04 |
shall be deferred until the
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility has completed processing.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
When options specifying multi-column output are specified, output text
|
|
Packit |
7cfc04 |
columns shall be of equal width; input lines that do not fit into a
|
|
Packit |
7cfc04 |
text column shall be truncated. By default, text columns shall be
|
|
Packit |
7cfc04 |
separated with at least one
|
|
Packit |
7cfc04 |
<blank>.
|
|
Packit |
7cfc04 |
.SH OPTIONS
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility shall conform to the Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "Section 12.2" ", " "Utility Syntax Guidelines",
|
|
Packit |
7cfc04 |
except that: the
|
|
Packit |
7cfc04 |
.IR page
|
|
Packit |
7cfc04 |
option has a
|
|
Packit |
7cfc04 |
.BR '\(pl'
|
|
Packit |
7cfc04 |
delimiter;
|
|
Packit |
7cfc04 |
.IR page
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.IR column
|
|
Packit |
7cfc04 |
can be multi-digit numbers; some of the option-arguments are optional;
|
|
Packit |
7cfc04 |
and some of the option-arguments cannot be specified as separate
|
|
Packit |
7cfc04 |
arguments from the preceding option letter. In particular, the
|
|
Packit |
7cfc04 |
.BR \(mis
|
|
Packit |
7cfc04 |
option does not allow the option letter to be separated from its
|
|
Packit |
7cfc04 |
argument, and the options
|
|
Packit |
7cfc04 |
.BR \(mie ,
|
|
Packit |
7cfc04 |
.BR \(mii ,
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR \(min
|
|
Packit |
7cfc04 |
require that both arguments, if present, not be separated from the
|
|
Packit |
7cfc04 |
option letter.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The following options shall be supported. In the following option
|
|
Packit |
7cfc04 |
descriptions,
|
|
Packit |
7cfc04 |
.IR column ,
|
|
Packit |
7cfc04 |
.IR lines ,
|
|
Packit |
7cfc04 |
.IR offset ,
|
|
Packit |
7cfc04 |
.IR page ,
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.IR width
|
|
Packit |
7cfc04 |
are positive decimal integers;
|
|
Packit |
7cfc04 |
.IR gap
|
|
Packit |
7cfc04 |
is a non-negative decimal integer.
|
|
Packit |
7cfc04 |
.IP "\fB+\fIpage\fR" 10
|
|
Packit |
7cfc04 |
Begin output at page number
|
|
Packit |
7cfc04 |
.IR page
|
|
Packit |
7cfc04 |
of the formatted input.
|
|
Packit |
7cfc04 |
.IP "\fB\(mi\fIcolumn\fR" 10
|
|
Packit |
7cfc04 |
Produce multi-column output that is arranged in
|
|
Packit |
7cfc04 |
.IR column
|
|
Packit |
7cfc04 |
columns (the default shall be 1) and is written down each column in the
|
|
Packit |
7cfc04 |
order in which the text is received from the input file. This option
|
|
Packit |
7cfc04 |
should not be used with
|
|
Packit |
7cfc04 |
.BR \(mim .
|
|
Packit |
7cfc04 |
The options
|
|
Packit |
7cfc04 |
.BR \(mie
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR \(mii
|
|
Packit |
7cfc04 |
shall be assumed for multiple text-column output. Whether or not text
|
|
Packit |
7cfc04 |
columns are produced with identical vertical lengths is unspecified,
|
|
Packit |
7cfc04 |
but a text column shall never exceed the length of the page (see the
|
|
Packit |
7cfc04 |
.BR \(mil
|
|
Packit |
7cfc04 |
option). When used with
|
|
Packit |
7cfc04 |
.BR \(mit ,
|
|
Packit |
7cfc04 |
use the minimum number of lines to write the output.
|
|
Packit |
7cfc04 |
.IP "\fB\(mia\fP" 10
|
|
Packit |
7cfc04 |
Modify the effect of the
|
|
Packit |
7cfc04 |
.BR \(mi \c
|
|
Packit |
7cfc04 |
.IR column
|
|
Packit |
7cfc04 |
option so that the columns are filled across the page in a round-robin
|
|
Packit |
7cfc04 |
order (for example, when
|
|
Packit |
7cfc04 |
.IR column
|
|
Packit |
7cfc04 |
is 2, the first input line heads column 1, the second heads column 2,
|
|
Packit |
7cfc04 |
the third is the second line in column 1, and so on).
|
|
Packit |
7cfc04 |
.IP "\fB\(mid\fP" 10
|
|
Packit |
7cfc04 |
Produce output that is double-spaced; append an extra
|
|
Packit |
7cfc04 |
<newline>
|
|
Packit |
7cfc04 |
following every
|
|
Packit |
7cfc04 |
<newline>
|
|
Packit |
7cfc04 |
found in the input.
|
|
Packit |
7cfc04 |
.IP "\fB\(mie[\fIchar\fB][\fIgap\fB]\fR" 10
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
Expand each input
|
|
Packit |
7cfc04 |
<tab>
|
|
Packit |
7cfc04 |
to the next greater column position specified by the formula
|
|
Packit |
7cfc04 |
.IR n *\c
|
|
Packit |
7cfc04 |
.IR gap +1,
|
|
Packit |
7cfc04 |
where
|
|
Packit |
7cfc04 |
.IR n
|
|
Packit |
7cfc04 |
is an integer > 0. If
|
|
Packit |
7cfc04 |
.IR gap
|
|
Packit |
7cfc04 |
is zero or is omitted, it shall default to 8. All
|
|
Packit |
7cfc04 |
<tab>
|
|
Packit |
7cfc04 |
characters in the input shall be expanded into the appropriate number of
|
|
Packit |
7cfc04 |
<space>
|
|
Packit |
7cfc04 |
characters. If any non-digit character,
|
|
Packit |
7cfc04 |
.IR char ,
|
|
Packit |
7cfc04 |
is specified, it shall be used as the input
|
|
Packit |
7cfc04 |
<tab>.
|
|
Packit |
7cfc04 |
If the first character of the
|
|
Packit |
7cfc04 |
.BR \(mie
|
|
Packit |
7cfc04 |
option-argument is a digit, the entire option-argument shall be assumed
|
|
Packit |
7cfc04 |
to be
|
|
Packit |
7cfc04 |
.IR gap .
|
|
Packit |
7cfc04 |
.IP "\fB\(mif\fP" 10
|
|
Packit |
7cfc04 |
Use a
|
|
Packit |
7cfc04 |
<form-feed>
|
|
Packit |
7cfc04 |
for new pages, instead of the default behavior that uses a sequence of
|
|
Packit |
7cfc04 |
<newline>
|
|
Packit |
7cfc04 |
characters. Pause before beginning the first page if the standard output
|
|
Packit |
7cfc04 |
is associated with a terminal.
|
|
Packit |
7cfc04 |
.IP "\fB\(miF\fP" 10
|
|
Packit |
7cfc04 |
Use a
|
|
Packit |
7cfc04 |
<form-feed>
|
|
Packit |
7cfc04 |
for new pages, instead of the default behavior that uses a sequence of
|
|
Packit |
7cfc04 |
<newline>
|
|
Packit |
7cfc04 |
characters.
|
|
Packit |
7cfc04 |
.IP "\fB\(mih\ \fIheader\fR" 10
|
|
Packit |
7cfc04 |
Use the string
|
|
Packit |
7cfc04 |
.IR header
|
|
Packit |
7cfc04 |
to replace the contents of the
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand in the page header.
|
|
Packit |
7cfc04 |
.IP "\fB\(mii[\fIchar\fB][\fIgap\fB]\fR" 10
|
|
Packit |
7cfc04 |
In output, replace
|
|
Packit |
7cfc04 |
<space>
|
|
Packit |
7cfc04 |
characters with
|
|
Packit |
7cfc04 |
<tab>
|
|
Packit |
7cfc04 |
characters wherever one or more adjacent
|
|
Packit |
7cfc04 |
<space>
|
|
Packit |
7cfc04 |
characters reach column positions
|
|
Packit |
7cfc04 |
.IR gap +1,
|
|
Packit |
7cfc04 |
2*
|
|
Packit |
7cfc04 |
.IR gap +1,
|
|
Packit |
7cfc04 |
3*
|
|
Packit |
7cfc04 |
.IR gap +1,
|
|
Packit |
7cfc04 |
and so on. If
|
|
Packit |
7cfc04 |
.IR gap
|
|
Packit |
7cfc04 |
is zero or is omitted, default tab settings at every eighth column
|
|
Packit |
7cfc04 |
position shall be assumed. If any non-digit character,
|
|
Packit |
7cfc04 |
.IR char ,
|
|
Packit |
7cfc04 |
is specified, it shall be used as the output
|
|
Packit |
7cfc04 |
<tab>.
|
|
Packit |
7cfc04 |
If the first character of the
|
|
Packit |
7cfc04 |
.BR \(mii
|
|
Packit |
7cfc04 |
option-argument is a digit, the entire option-argument shall be assumed
|
|
Packit |
7cfc04 |
to be
|
|
Packit |
7cfc04 |
.IR gap .
|
|
Packit |
7cfc04 |
.IP "\fB\(mil\ \fIlines\fR" 10
|
|
Packit |
7cfc04 |
Override the 66-line default and reset the page length to
|
|
Packit |
7cfc04 |
.IR lines .
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR lines
|
|
Packit |
7cfc04 |
is not greater than the sum of both the header and trailer depths (in
|
|
Packit |
7cfc04 |
lines), the
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility shall suppress both the header and trailer, as if the
|
|
Packit |
7cfc04 |
.BR \(mit
|
|
Packit |
7cfc04 |
option were in effect.
|
|
Packit |
7cfc04 |
.IP "\fB\(mim\fP" 10
|
|
Packit |
7cfc04 |
Merge files. Standard output shall be formatted so the
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility writes one line from each file specified by a
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand, side by side into text columns of equal fixed widths, in terms
|
|
Packit |
7cfc04 |
of the number of column positions. Implementations shall support
|
|
Packit |
7cfc04 |
merging of at least nine
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operands.
|
|
Packit |
7cfc04 |
.IP "\fB\(min[\fIchar\fB][\fIwidth\fB]\fR" 10
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
Provide
|
|
Packit |
7cfc04 |
.IR width -digit
|
|
Packit |
7cfc04 |
line numbering (default for
|
|
Packit |
7cfc04 |
.IR width
|
|
Packit |
7cfc04 |
shall be 5). The number shall occupy the first
|
|
Packit |
7cfc04 |
.IR width
|
|
Packit |
7cfc04 |
column positions of each text column of default output or each line of
|
|
Packit |
7cfc04 |
.BR \(mim
|
|
Packit |
7cfc04 |
output. If
|
|
Packit |
7cfc04 |
.IR char
|
|
Packit |
7cfc04 |
(any non-digit character) is given, it shall be appended to the line
|
|
Packit |
7cfc04 |
number to separate it from whatever follows (default for
|
|
Packit |
7cfc04 |
.IR char
|
|
Packit |
7cfc04 |
is a
|
|
Packit |
7cfc04 |
<tab>).
|
|
Packit |
7cfc04 |
.IP "\fB\(mio\ \fIoffset\fR" 10
|
|
Packit |
7cfc04 |
Each line of output shall be preceded by offset
|
|
Packit |
7cfc04 |
<space>
|
|
Packit |
7cfc04 |
characters. If the
|
|
Packit |
7cfc04 |
.BR \(mio
|
|
Packit |
7cfc04 |
option is not specified, the default offset shall be zero. The space
|
|
Packit |
7cfc04 |
taken is in addition to the output line width (see the
|
|
Packit |
7cfc04 |
.BR \(miw
|
|
Packit |
7cfc04 |
option below).
|
|
Packit |
7cfc04 |
.IP "\fB\(mip\fP" 10
|
|
Packit |
7cfc04 |
Pause before beginning each page if the standard output is directed to
|
|
Packit |
7cfc04 |
a terminal (\c
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
shall write an
|
|
Packit |
7cfc04 |
<alert>
|
|
Packit |
7cfc04 |
to standard error and wait for a
|
|
Packit |
7cfc04 |
<carriage-return>
|
|
Packit |
7cfc04 |
to be read on
|
|
Packit |
7cfc04 |
.BR /dev/tty ).
|
|
Packit |
7cfc04 |
.IP "\fB\(mir\fP" 10
|
|
Packit |
7cfc04 |
Write no diagnostic reports on failure to open files.
|
|
Packit |
7cfc04 |
.IP "\fB\(mis[\fIchar\fB]\fR" 10
|
|
Packit |
7cfc04 |
Separate text columns by the single character
|
|
Packit |
7cfc04 |
.IR char
|
|
Packit |
7cfc04 |
instead of by the appropriate number of
|
|
Packit |
7cfc04 |
<space>
|
|
Packit |
7cfc04 |
characters (default for
|
|
Packit |
7cfc04 |
.IR char
|
|
Packit |
7cfc04 |
shall be
|
|
Packit |
7cfc04 |
<tab>).
|
|
Packit |
7cfc04 |
.IP "\fB\(mit\fP" 10
|
|
Packit |
7cfc04 |
Write neither the five-line identifying header nor the five-line
|
|
Packit |
7cfc04 |
trailer usually supplied for each page. Quit writing after the last
|
|
Packit |
7cfc04 |
line of each file without spacing to the end of the page.
|
|
Packit |
7cfc04 |
.IP "\fB\(miw\ \fIwidth\fR" 10
|
|
Packit |
7cfc04 |
Set the width of the line to
|
|
Packit |
7cfc04 |
.IR width
|
|
Packit |
7cfc04 |
column positions for multiple text-column output only. If the
|
|
Packit |
7cfc04 |
.BR \(miw
|
|
Packit |
7cfc04 |
option is not specified and the
|
|
Packit |
7cfc04 |
.BR \(mis
|
|
Packit |
7cfc04 |
option is not specified, the default width shall be 72. If the
|
|
Packit |
7cfc04 |
.BR \(miw
|
|
Packit |
7cfc04 |
option is not specified and the
|
|
Packit |
7cfc04 |
.BR \(mis
|
|
Packit |
7cfc04 |
option is specified, the default width shall be 512.
|
|
Packit |
7cfc04 |
.RS 10
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
For single column output, input lines shall not be truncated.
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.SH OPERANDS
|
|
Packit |
7cfc04 |
The following operand shall be supported:
|
|
Packit |
7cfc04 |
.IP "\fIfile\fR" 10
|
|
Packit |
7cfc04 |
A pathname of a file to be written. If no
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operands are specified, or if a
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand is
|
|
Packit |
7cfc04 |
.BR '\(mi' ,
|
|
Packit |
7cfc04 |
the standard input shall be used.
|
|
Packit |
7cfc04 |
.SH STDIN
|
|
Packit |
7cfc04 |
The standard input shall be used only if no
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operands are specified, or if a
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand is
|
|
Packit |
7cfc04 |
.BR '\(mi' .
|
|
Packit |
7cfc04 |
See the INPUT FILES section.
|
|
Packit |
7cfc04 |
.SH "INPUT FILES"
|
|
Packit |
7cfc04 |
The input files shall be text files.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The file
|
|
Packit |
7cfc04 |
.BR /dev/tty
|
|
Packit |
7cfc04 |
shall be used to read responses required by the
|
|
Packit |
7cfc04 |
.BR \(mip
|
|
Packit |
7cfc04 |
option.
|
|
Packit |
7cfc04 |
.SH "ENVIRONMENT VARIABLES"
|
|
Packit |
7cfc04 |
The following environment variables shall affect the execution of
|
|
Packit |
7cfc04 |
.IR pr :
|
|
Packit |
7cfc04 |
.IP "\fILANG\fP" 10
|
|
Packit |
7cfc04 |
Provide a default value for the internationalization variables that are
|
|
Packit |
7cfc04 |
unset or null. (See the Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "Section 8.2" ", " "Internationalization Variables"
|
|
Packit |
7cfc04 |
the precedence of internationalization variables used to determine the
|
|
Packit |
7cfc04 |
values of locale categories.)
|
|
Packit |
7cfc04 |
.IP "\fILC_ALL\fP" 10
|
|
Packit |
7cfc04 |
If set to a non-empty string value, override the values of all the
|
|
Packit |
7cfc04 |
other internationalization variables.
|
|
Packit |
7cfc04 |
.IP "\fILC_CTYPE\fP" 10
|
|
Packit |
7cfc04 |
Determine the locale for the interpretation of sequences of bytes of
|
|
Packit |
7cfc04 |
text data as characters (for example, single-byte as opposed to
|
|
Packit |
7cfc04 |
multi-byte characters in arguments and input files) and which
|
|
Packit |
7cfc04 |
characters are defined as printable (character class
|
|
Packit |
7cfc04 |
.BR print ).
|
|
Packit |
7cfc04 |
Non-printable characters are still written to standard output, but are
|
|
Packit |
7cfc04 |
not counted for the purpose for column-width and line-length
|
|
Packit |
7cfc04 |
calculations.
|
|
Packit |
7cfc04 |
.IP "\fILC_MESSAGES\fP" 10
|
|
Packit |
7cfc04 |
.br
|
|
Packit |
7cfc04 |
Determine the locale that should be used to affect the format and
|
|
Packit |
7cfc04 |
contents of diagnostic messages written to standard error.
|
|
Packit |
7cfc04 |
.IP "\fILC_TIME\fP" 10
|
|
Packit |
7cfc04 |
Determine the format of the date and time for use in writing header
|
|
Packit |
7cfc04 |
lines.
|
|
Packit |
7cfc04 |
.IP "\fINLSPATH\fP" 10
|
|
Packit |
7cfc04 |
Determine the location of message catalogs for the processing of
|
|
Packit |
7cfc04 |
.IR LC_MESSAGES .
|
|
Packit |
7cfc04 |
.IP "\fITZ\fP" 10
|
|
Packit |
7cfc04 |
Determine the timezone used to calculate date and time strings written
|
|
Packit |
7cfc04 |
in header lines. If
|
|
Packit |
7cfc04 |
.IR TZ
|
|
Packit |
7cfc04 |
is unset or null, an unspecified default timezone shall be used.
|
|
Packit |
7cfc04 |
.SH "ASYNCHRONOUS EVENTS"
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
receives an interrupt while writing to a terminal, it shall flush all
|
|
Packit |
7cfc04 |
accumulated error messages to the screen before terminating.
|
|
Packit |
7cfc04 |
.SH STDOUT
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility output shall be a paginated version of the original file (or
|
|
Packit |
7cfc04 |
files). This pagination shall be accomplished using either
|
|
Packit |
7cfc04 |
<form-feed>
|
|
Packit |
7cfc04 |
characters or a sequence of
|
|
Packit |
7cfc04 |
<newline>
|
|
Packit |
7cfc04 |
characters, as controlled by the
|
|
Packit |
7cfc04 |
.BR \(miF
|
|
Packit |
7cfc04 |
or
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
option. Page headers shall be generated unless the
|
|
Packit |
7cfc04 |
.BR \(mit
|
|
Packit |
7cfc04 |
option is specified. The page headers shall be of the form:
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
"\en\en%s %s Page %d\en\en\en", <\fIoutput of date\fP>, <\fIfile\fR>, <\fIpage number\fR>
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
In the POSIX locale, the <\fIoutput\ of\ date\fR> field, representing
|
|
Packit |
7cfc04 |
the date and time of last modification of the input file (or the
|
|
Packit |
7cfc04 |
current date and time if the input file is standard input), shall be
|
|
Packit |
7cfc04 |
equivalent to the output of the following command as it would appear if
|
|
Packit |
7cfc04 |
executed at the given time:
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
date "+%b %e %H:%M %Y"
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
without the trailing
|
|
Packit |
7cfc04 |
<newline>,
|
|
Packit |
7cfc04 |
if the page being written is from standard input. If the page being
|
|
Packit |
7cfc04 |
written is not from standard input, in the POSIX locale, the same
|
|
Packit |
7cfc04 |
format shall be used, but the time used shall be the modification time
|
|
Packit |
7cfc04 |
of the file corresponding to
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
instead of the current time. When the
|
|
Packit |
7cfc04 |
.IR LC_TIME
|
|
Packit |
7cfc04 |
locale category is not set to the POSIX locale, a different format and
|
|
Packit |
7cfc04 |
order of presentation of this field may be used.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the standard input is used instead of a
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand, the <\fIfile\fP> field shall be replaced by a null string.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If the
|
|
Packit |
7cfc04 |
.BR \(mih
|
|
Packit |
7cfc04 |
option is specified, the <\fIfile\fP> field shall be replaced by the
|
|
Packit |
7cfc04 |
.IR header
|
|
Packit |
7cfc04 |
argument.
|
|
Packit |
7cfc04 |
.SH STDERR
|
|
Packit |
7cfc04 |
The standard error shall be used for diagnostic messages and
|
|
Packit |
7cfc04 |
for alerting the terminal when
|
|
Packit |
7cfc04 |
.BR \(mip
|
|
Packit |
7cfc04 |
is specified.
|
|
Packit |
7cfc04 |
.SH "OUTPUT FILES"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "EXTENDED DESCRIPTION"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "EXIT STATUS"
|
|
Packit |
7cfc04 |
The following exit values shall be returned:
|
|
Packit |
7cfc04 |
.IP "\00" 6
|
|
Packit |
7cfc04 |
Successful completion.
|
|
Packit |
7cfc04 |
.IP >0 6
|
|
Packit |
7cfc04 |
An error occurred.
|
|
Packit |
7cfc04 |
.SH "CONSEQUENCES OF ERRORS"
|
|
Packit |
7cfc04 |
Default.
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.IR "The following sections are informative."
|
|
Packit |
7cfc04 |
.SH "APPLICATION USAGE"
|
|
Packit |
7cfc04 |
A conforming application must protect its first operand, if it starts
|
|
Packit |
7cfc04 |
with a
|
|
Packit |
7cfc04 |
<plus-sign>,
|
|
Packit |
7cfc04 |
by preceding it with the
|
|
Packit |
7cfc04 |
.BR \(dq\(mi\|\(mi\(dq
|
|
Packit |
7cfc04 |
argument that denotes the end of the options. For example,
|
|
Packit |
7cfc04 |
.IR pr \(pl\c
|
|
Packit |
7cfc04 |
.IR x
|
|
Packit |
7cfc04 |
could be interpreted as an invalid page number or a
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand.
|
|
Packit |
7cfc04 |
.SH EXAMPLES
|
|
Packit |
7cfc04 |
.IP " 1." 4
|
|
Packit |
7cfc04 |
Print a numbered list of all files in the current directory:
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
ls \(mia | pr \(min \(mih "Files in $(pwd)."
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.IP " 2." 4
|
|
Packit |
7cfc04 |
Print
|
|
Packit |
7cfc04 |
.BR file1
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR file2
|
|
Packit |
7cfc04 |
as a double-spaced, three-column listing headed by ``file list'':
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
pr \(mi3d \(mih "file list" file1 file2
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.IP " 3." 4
|
|
Packit |
7cfc04 |
Write
|
|
Packit |
7cfc04 |
.BR file1
|
|
Packit |
7cfc04 |
on
|
|
Packit |
7cfc04 |
.BR file2 ,
|
|
Packit |
7cfc04 |
expanding tabs to columns 10, 19, 28, .\|.\|.:
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
pr \(mie9 \(mit <file1 >file2
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.SH RATIONALE
|
|
Packit |
7cfc04 |
This utility is one of those that does not follow the Utility Syntax
|
|
Packit |
7cfc04 |
Guidelines because of its historical origins. The standard developers
|
|
Packit |
7cfc04 |
could have added new options that obeyed the guidelines (and marked the
|
|
Packit |
7cfc04 |
old options obsolescent) or devised an entirely new utility; there are
|
|
Packit |
7cfc04 |
examples of both actions in this volume of POSIX.1\(hy2008. Because of its widespread use by
|
|
Packit |
7cfc04 |
historical applications, the standard developers decided to exempt this
|
|
Packit |
7cfc04 |
version of
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
from many of the guidelines.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Implementations are required to accept option-arguments to the
|
|
Packit |
7cfc04 |
.BR \(mih ,
|
|
Packit |
7cfc04 |
.BR \(mil ,
|
|
Packit |
7cfc04 |
.BR \(mio ,
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR \(miw
|
|
Packit |
7cfc04 |
options whether presented as part of the same argument or as a separate
|
|
Packit |
7cfc04 |
argument to
|
|
Packit |
7cfc04 |
.IR pr ,
|
|
Packit |
7cfc04 |
as suggested by the Utility Syntax Guidelines. The
|
|
Packit |
7cfc04 |
.BR \(min
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR \(mis
|
|
Packit |
7cfc04 |
options, however, are specified as in historical practice because they
|
|
Packit |
7cfc04 |
are frequently specified without their optional arguments. If a
|
|
Packit |
7cfc04 |
<blank>
|
|
Packit |
7cfc04 |
were allowed before the option-argument in these cases, a
|
|
Packit |
7cfc04 |
.IR file
|
|
Packit |
7cfc04 |
operand could mistakenly be interpreted as an option-argument in
|
|
Packit |
7cfc04 |
historical applications.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The text about the minimum number of lines in multi-column output was
|
|
Packit |
7cfc04 |
included to ensure that a best effort is made in balancing the length
|
|
Packit |
7cfc04 |
of the columns. There are known historical implementations in which,
|
|
Packit |
7cfc04 |
for example, 60-line files are listed by
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
\(mi2 as one column of 56 lines and a second of 4. Although this is not
|
|
Packit |
7cfc04 |
a problem when a full page with headers and trailers is produced, it
|
|
Packit |
7cfc04 |
would be relatively useless when used with
|
|
Packit |
7cfc04 |
.BR \(mit .
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Historical implementations of the
|
|
Packit |
7cfc04 |
.IR pr
|
|
Packit |
7cfc04 |
utility have differed in the action taken for the
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
option. BSD uses it as described here for the
|
|
Packit |
7cfc04 |
.BR \(miF
|
|
Packit |
7cfc04 |
option; System V uses it to change trailing
|
|
Packit |
7cfc04 |
<newline>
|
|
Packit |
7cfc04 |
characters on each page to a
|
|
Packit |
7cfc04 |
<form-feed>
|
|
Packit |
7cfc04 |
and, if standard output is a TTY device, sends an
|
|
Packit |
7cfc04 |
<alert>
|
|
Packit |
7cfc04 |
to standard error and reads a line from
|
|
Packit |
7cfc04 |
.BR /dev/tty
|
|
Packit |
7cfc04 |
before the first page. There were strong arguments from both sides of
|
|
Packit |
7cfc04 |
this issue concerning historical practice and as a result the
|
|
Packit |
7cfc04 |
.BR \(miF
|
|
Packit |
7cfc04 |
option was added. XSI-conformant systems support the System V
|
|
Packit |
7cfc04 |
historical actions for the
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
option.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The <\fIoutput\ of\ date\fP> field in the
|
|
Packit |
7cfc04 |
.BR \(mil
|
|
Packit |
7cfc04 |
format is specified only for the POSIX locale. As noted, the format can
|
|
Packit |
7cfc04 |
be different in other locales. No mechanism for defining this is
|
|
Packit |
7cfc04 |
present in this volume of POSIX.1\(hy2008, as the appropriate vehicle is a message catalog;
|
|
Packit |
7cfc04 |
that is, the format should be specified as a ``message''.
|
|
Packit |
7cfc04 |
.SH "FUTURE DIRECTIONS"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "SEE ALSO"
|
|
Packit |
7cfc04 |
.IR "\fIexpand\fR\^",
|
|
Packit |
7cfc04 |
.IR "\fIlp\fR\^"
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "Chapter 8" ", " "Environment Variables",
|
|
Packit |
7cfc04 |
.IR "Section 12.2" ", " "Utility Syntax Guidelines"
|
|
Packit |
7cfc04 |
.SH COPYRIGHT
|
|
Packit |
7cfc04 |
Portions of this text are reprinted and reproduced in electronic form
|
|
Packit |
7cfc04 |
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
|
|
Packit |
7cfc04 |
-- Portable Operating System Interface (POSIX), The Open Group Base
|
|
Packit |
7cfc04 |
Specifications Issue 7, Copyright (C) 2013 by the Institute of
|
|
Packit |
7cfc04 |
Electrical and Electronics Engineers, Inc and The Open Group.
|
|
Packit |
7cfc04 |
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
|
|
Packit |
7cfc04 |
event of any discrepancy between this version and the original IEEE and
|
|
Packit |
7cfc04 |
The Open Group Standard, the original IEEE and The Open Group Standard
|
|
Packit |
7cfc04 |
is the referee document. The original Standard can be obtained online at
|
|
Packit |
7cfc04 |
http://www.unix.org/online.html .
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
Any typographical or formatting errors that appear
|
|
Packit |
7cfc04 |
in this page are most likely
|
|
Packit |
7cfc04 |
to have been introduced during the conversion of the source files to
|
|
Packit |
7cfc04 |
man page format. To report such errors, see
|
|
Packit |
7cfc04 |
https://www.kernel.org/doc/man-pages/reporting_bugs.html .
|