gettxt(1)gettxt(1)NAMEgettxt - Retrieves a text string from a message data base
SYNOPSISgettxt msgfile:msgnum [dflt_msg]
OPERANDS
The name of the file in the directory /usr/lib/locale/locale/LC_MES‐
SAGES where you can retrieve msgnum. The name of msgfile can be up to
14 characters in length, but should not contain either \0 (null) or the
ASCII code for / (slash) or : (colon). The sequence number of the
string to retrieve from msgfile. The strings in the msgfile are num‐
bered sequentially from 1 to n, where n is the number of strings in the
file. The default string to be displayed if gettxt fails to retrieve
msgnum from msgfile. The non-graphic characters must be represented in
alphabetical list of escape sequences.
DESCRIPTION
The gettxt command retrieves a text string from a message file in the
directory /usr/lib/locale/locale/LC_MESSAGES. The directory name
'locale' corresponds to the language in which the text strings are
written (see setlocale(3)for further information).
The text string to be retrieved is in the file msgfile, which is cre‐
ated by the mkmsgs command and installed under the directory
/usr/lib/locale/locale/LC_MESSAGES. The user controls the selection of
the directory being searched, by setting the environment variable
LC_MESSAGES. If the environment variable LC_MESSAGES has notbeen set,
then the environment variable LANG is used. If the environment variable
LANG is not set, then the files containing the strings are under the
directory /usr/lib/locale/C/LC_MESSAGES.
If the gettxt command fails to retrieve a message in the requested lan‐
guage, the same message could be retrieved from
/usr/lib/locale/C/LC_MESSAGES/msgfile. In the event of continued fail‐
ure, if dflt_msg is present and not null, then it will display the
value of dflt_msg; if dflt_msg is not present or is null, then it will
display the string Message not found!!.
EXAMPLE
If the environment variables LANG or LC_MESSAGES have not been set to
anything other than their default values, the gettxt command tries to
retrieve the 10th message from /usr/lib/locale/C/LC_MESSAGES/UX in the
following manner: $ gettxt UX:10 "hello world\n"
If the retrieval fails, the message "hello world"is displayed and is
followed by a new line .
FILES
The default message files created by mkmsgs. The message files for
different languages created by mkmsgs.
SEE ALSO
Commands: mkmsgs(1), srchtxt(1)
Functions: gettxt(3C), setlocale(3C)gettxt(1)