Universal Message Translator - Usage
Input
UMET requires two input files:
- Message Input file (user-specified or standard input) containing the error messages that are to be translated into a return codes.
- Translation Table file containing the user-defined translation table that controls the error message-to-return code translation process.
Translation Steps
To perform a translation, UMET:
- Reads the messages in the input file.
- Matches each line against the translation table entries.
- Exits with an return code from the best match in the translation table.
If no match is found, UMET ends with return code 0.
UMET performs operations specified by the configuration options.
Translation Table
The translation table specifies:
- Text to search for.
- Return code associated with the text.
- Precedence when multiple matches are found.
Translation Table Format
The translation table consists of one or more lines.
Each line is either:
- Comment line (# in column one)
- Blank line (ignored)
- Translation table entry
Translation table entries consist of two fields separated by spaces or tabs. An entry cannot be continued onto multiple lines.
Translation Table Fields
Field |
Description |
---|---|
Message Mask |
Selects which messages to match in the input file. The mask must be enclosed in double ( " ) quotation marks. |
Exit Code |
Specifies an integer value that UMET exits with if this entry is the resulting match. |
Matching Algorithm
The input file is read line by line. For each line, the line is compared to each entry in the translation table. All the matching entries are saved.
After the entire input file is read, the matched entries from the translation table are sorted in ascending order by their line number in the translation table. The first entry in this sorted list is the resulting translation table entry. The exit code from the resulting translation table entry is used as the return code of UMET. If no matching entry is found, UMET exits with 0.