Universal Message Translator - Usage

Input

UMET requires two input files:

  1. Message Input file (user-specified or standard input) containing the error messages that are to be translated into a return codes.
  2. 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:

  1. Reads the messages in the input file.
  2. Matches each line against the translation table entries.
  3. 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.
 
Mask characters include the asterisks ( * ) and the question mark ( ? ). The asterisk matches 0 or more characters and the question mark matches one character.
 
If an asterisk, question mark, or quotation mark is required in the message text, it must be preceded with a back slash ( \ ). If a back slash is required in the message text, it must be preceded by another back slash.

Exit Code

Specifies an integer value that UMET exits with if this entry is the resulting match.
 
The exit code is in the range of -99999 to 99999.

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.