以 PDF 格式下载本书 (6904 KB)
srchtxt(1)Name | Synopsis | Description | Options | Examples | Environment Variables | Files | Attributes | See Also | Diagnostics Name
Synopsissrchtxt [-s] [-l locale] [-m msgfile ,...] [text] Description
The srchtxt utility is used to display all the text strings in message data bases, or to search for a text string in message data bases (see mkmsgs(1)). These data bases are files in the directory /usr/lib/locale/locale/LC_MESSAGES (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 LC_MESSAGES. If LC_MESSAGES 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/LC_MESSAGES , which contains default strings. If no text argument is present, then all the text strings in the files accessed will be displayed. 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>. This display is in the format used by gettxt(1) and gettxt(3C). Options
ExamplesExample 1 Using srchtxtIf message files have been installed in a locale named french by using mkmsgs(1), then you could display the entire set of text strings in the french locale (/usr/lib/locale/french/LC_MESSAGES/* ) by typing:
Example 2 Using srchtxtIf a set of error messages associated with the operating system have been installed in the file UX in the french locale (/usr/lib/locale/french/LC_MESSAGE/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:
If /usr/lib/locale/french/LC_MESSAGES/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:
Example 3 Using srchtxtIf a set of error messages associated with the operating system have been installed in the file UX and a set of error messages associated with the INGRESS data base product have been installed in the file ingress, both in the german locale, then you could search for the pattern [Dd]atei in both the files UX and ingress in the german locale by typing:
Environment VariablesSee environ(5) for a description of the LC_CTYPE environment variable that affects the execution of srchtxt. FilesAttributesSee attributes(5) for descriptions of the following attributes:
See Alsoexstr(1), gettxt(1), locale(1), mkmsgs(1), gettxt(3C), setlocale(3C), attributes(5), environ(5), locale(5), regexp(5) DiagnosticsThe 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. Name | Synopsis | Description | Options | Examples | Environment Variables | Files | Attributes | See Also | Diagnostics |
|||||||||