srchtxt(1) DG/UX R4.11MU05 srchtxt(1)
NAME
srchtxt - display contents of or search for text string in message
databases
SYNOPSIS
srchtxt [-s] [-l locale] [-m msgfile, ...] [text]
DESCRIPTION
The srchtxt utility is used to display all the text strings in
message databases, or to search for a text string in message
databases (see mkmsgs(1)). These databases are files in the
directory /usr/lib/locale/locale/LCMESSAGES (see setlocale(3C)),
unless a file name given with the -m option contains a /. The
directory locale can be viewed as the name of the language in which
the text strings are written. If the -l option is not specified, the
files accessed will be determined by the value of the environment
variable LCMESSAGES. If LCMESSAGES is not set, the files accessed
will be determined by the value of the environment variable LANG. If
LANG is not set, the files accessed will be in the directory
/usr/lib/locale/C/LCMESSAGES, which contains default strings.
If no text argument is present, then all the text strings in the
files accessed will be displayed.
Options are:
-s suppress printing of the message sequence numbers of the
messages being displayed
-l locale access files in the directory
/usr/lib/locale/locale/LCMESSAGES. If -m msgfile is
also supplied, locale is ignored for msgfiles containing
a /.
-m msgfile access file(s) specified by one or more msgfiles. If
msgfile contains a / character, then msgfile is
interpreted as a pathname; otherwise, it will be assumed
to be in the directory determined as described above. To
specify more than one msgfile, separate the file names
using commas.
text search for the text string specified by text and display
each one that matches. text can take the form of a
regular expression (see ed(1)).
If the -s option is not specified, the displayed text is prefixed by
message sequence numbers. The message sequence numbers are enclosed
in angle brackets: <msgfile:msgnum>.
msgfile name of the file where the displayed text occurred
msgnum sequence number in msgfile where the displayed text
occurred
This display is in the format used by gettxt(1) and gettxt(3C).
srchtxt can search the characters from supplementary code sets of
text strings in the message handling facility for a text string.
EXAMPLES
The following examples show uses of srchtxt.
Example 1:
If message files have been installed in a locale named fr by using
mkmsgs(1), then you could display the entire set of text strings in
the fr locale (/usr/lib/locale/fr/LCMESSAGES/*) by typing:
srchtxt -l fr
Example 2:
If a set of error messages associated with the UNIX operating system
have been installed in the file UX in the fr locale
(/usr/lib/locale/fr/LCMESSAGES/UX), then, using the value of the
LANG environment variable to determine the locale to be searched, you
could search that file in that locale for all error messages dealing
with files by typing:
LANG=fr; export LANG
srchtxt -m UX "[Ff]ichier"
If /usr/lib/locale/fr/LCMESSAGES/UX contained the following strings:
Erreur E/S\n
Liste d'arguments trop longue\n
Fichier inexistant\n
Argument invalide\n
Trop de fichiers ouverts\n
Fichier trop long\n
Trop de liens\n
Argument hors du domaine\n
Identificateur supprim\n
Etreinte fatale\n
.
.
.
then the following strings would be displayed:
<UX:3>Fichier inexistant\n
<UX:5>Trop de fichiers ouverts\n
<UX:6>Fichier trop long\n
FILES
/usr/lib/locale/C/LCMESSAGES/* default files created by
mkmsgs(1)
/usr/lib/locale/locale/LCMESSAGES/* message files created by
mkmsgs(1)
DIAGNOSTICS
The error messages produced by srchtxt are intended to be self-
explanatory. They indicate an error in the command line or errors
encountered while searching for a particular locale and/or message
file.
SEE ALSO
ed(1), exstr(1), gettxt(1), mkmsgs(1), gettxt(3C), setlocale(3C).
Licensed material--property of copyright holder(s)