HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)
d
dspmsg(1) dspmsg(1)
Using the CAT_MIDSET* Environment Variables
The CAT_MIDSET_ catname and CAT_MIDSET environment variables are used to control how to activate
the message identifier feature. You can use them to specify a space-separated list of numeric identifiers for
the sets containing messages that will be displayed with message identifiers. For example, if you set one of
these variables to "3 4", only messages in sets 3 and 4 will have their message identfiers displayed. The
messages in other sets in the message catalog will be displayed without their message identifiers. If you set
one of these variables to "", this will disable display of message identifiers for all sets in the message cata-
log.
The dspmsg command checks for the CAT_MIDSET_
catname and CAT_MIDSET environment variables
only when the
-e option is specified. When this option is specified,
dspmsg first determines if the
CAT_MIDSET_ catname environment variable is set. If it is set, and message_number is in one of the sets
specified by the variable,
dspmsg
precedes the specified message with its message identifier. If a catalog-
specific environment variable is not set,
dspmsg searches for the CAT_MIDSET environment variable and
uses its setting. If neither environment variable is set,
dspmsg does not display message identifiers.
Usually, application programmers want to display message identifiers only for messages that are warning
or error conditions. If a message catalog is well designed, messages associated with these conditions reside
in different sets from those containing informational messages or background text strings. You can set the
CAT_MIDSET_ catname environment variable to list only the message sets that contain warnings or errors
and then use dspmsg -e to confine display of message identifiers to those kinds of messages.
Using the CAT_MIDFMT* Environment Variables
The CAT_MIDFMT_ catname and CAT_MIDFMT environment variables control the format of the message
identifier. One of these environment variables must be defined to enable display of identifiers with the
-E
option. These variables can be defined to override the default format used for identifiers displayed through
the -e option. The dspmsg command first checks the catalog-specific environment variable and then, if
the catalog-specific version is not found, checks for the
CAT_MIDFMT environment variable.
The value of the
CAT_MIDFMT* environment variables can include one or more of the following substitu-
tion directives (in any order):
%C The message catalog name without the file extension.
%S The identifier for the message set. This is the numeric constant identifier.
%M The message identifier. This is the numeric constant identifier.
%D The default format. If specified first in the format string, the default format ("
%C%/%S%/%M:
"). If not specified first in the format string, the %D substitution directive is ignored.
The format can include additional ASCII characters, such as the space or colon, as delimiters between seg-
ments of the identifier. However, you cannot include the percent (
%) character as a delimiter because of its
special meaning to the shell.
Following are some example formats and resulting message identifiers and strings. Assume for these
examples that the catalog name is du, the message set identifier is 3, the message identifier is 2, and the
message string is "Out of memory".
• "
%C/%S/%M: "
du/3/2: Out of memory
• "%D"
du/3/2: Out of memory
• "%C-%M: "
du-2: Out of memory
• "%C %M: "
du 2: Out of memory
EXTERNAL INFLUENCES
Environment Variables
LANG provides a default value for the internationalization variables that are unset or null. If LANG is
unset or null, it defaults to C (see lang(5)).
HP-UX 11i Version 3: February 2007 − 3 − Hewlett-Packard Company 243