pfmt(1) pfmt(1)
pfmt - display error message in standard format
pfmt [-l label<b>][-s severity<b>][-g catalog<b>:msgid<b>] format <b>[args<b>]
pfmt uses format for printf style formatting of args. pfmt encapsulates
the output in the standard error message format and displays it on
stderr.
The following options are available.
-l label Specify the label string to be displayed with the message
(for example, "UX:cat"). label is a character string no more
than 25 characters in length; it will be automatically
suffixed with a colon (:). When unspecified, no label is
displayed as part of the message or when the environment
variable NOMSGLABEL has been set. Setting the NOMSGLABEL to
turn off the label portion of the message. Can be used in
conjunction with the NOMSGSEVERITY environment variable.
-s severity Specify the severity string to be displayed with the message.
Acceptable strings include the standard severities in either
their print string (that is, HALT, ERROR, INFO, WARNING, and
"TO FIX") or keyword (that is, halt, error, info, warn, and
action) forms, or any other user-defined string. A userdefined
string will be assigned the integer severity value of
5. The severity will be suffixed with a colon (:). The
ERROR severity will be used if no severity is specified,
unless the NOMSGSEVERITY environment variable has been set.
Setting the NOMSGSEVERITY to turn off the severity portion of
the message. Can be used in conjunction with the NOMSGLABEL
environment variable.
-g catalog<b>:msgid
Specify that a localized version of format should be
retrieved from a locale-specific message database. catalog
indicates the message database that contains the localized
version of the format string. catalog must be limited to 14
characters. These characters must be selected from a set of
all characters values, excluding \0 (NULL) or the characters
/ (slash) and : (colon).
msgid is a positive number that indicates the index of the
string into the message database.
If catalog does not exist in the current locale (identified
by the LC_MESSAGES or LANG environment variables), or if
msgid is out of bounds, pfmt will attempt to retrieve the
message from the C locale. If this second retrieval fails,
pfmt uses the format string as passed on the command line.
pfmt will output Message not found!!\n as the format string
Page 1
pfmt(1) pfmt(1)
if msgid is not a valid number.
Standard Error Message Format [Toc] [Back]
pfmt displays error messages in the following format:
label<b>: severity<b>: text
If no label was defined using the -l label option, the message is
displayed in the format:
severity<b>: text
If pfmt is called twice to display an error message and a helpful action
or recovery message, the output can look like the following:
label<b>: severity<b>: text
label<b>: TO FIX: text
Example 1:
pfmt -l UX:test -s error "Syntax error\n"
displays the message:
UX:test: ERROR: Syntax error
gettxt(1), lfmt(1), printf(1), lfmt(3C), pfmt(3C), environ(5)
Upon success, pfmt exits with code 0.
Upon failure, pfmt exits with the following codes:
1 write error
3 syntax error
PPPPaaaaggggeeee 2222 [ Back ]
|