gencat - Creates and modifies a message catalog
gencat catalog_file source_file...
Interfaces documented on this reference page conform to industry standards as follows:
Refer to the
reference page for more information
about industry standards and associated tags.
Specifies the message catalog to be modified or created. You can substitute - (a dash) for this operand to direct command results to the standard output rather than to a file.
The gencat command creates or modifies a message catalog from a message text source file.
A message text source file is a text file that you create to hold messages printed by your program. You can use any text editor to enter messages into the text source file. Messages can be grouped into sets, generally to represent functional subsets of your program. Each message has a numeric identifier, which must be unique within its set. The message text source file can also contain commands recognized by gencat for manipulating sets and individual messages.
[Compaq] Programmers can use symbolic names rather than numeric constants to refer to messages within programs. The gencat utility does not recognize symbolic names, but Tru64 UNIX provides a utility named mkcatdefs that: Accepts messages preceded by a symbolic name and assigns a numeric value to each Creates a header file that applications can include to map message symbols to their numeric values
[Compaq] Therefore, the most convenient way to generate a message catalog is to pass your symbolic constants and associated messages through mkcatdefs and then pass its output to gencat.
If a message catalog with the name catalog_file exists, gencat modifies it according to the statements in the message source files. If the catalog does not exist, gencat creates the catalog with the name catalog_file.
You can specify any number of message text source files. The gencat command processes multiple source files one after the other in the sequence that you specify them. Each successive source file modifies the catalog. If you specify - (a dash) in place of source_file, the gencat command accepts message source data from the standard input. Note that you can specify a - (dash) for the catalog file (standard output), the source file (standard input), or both.
The source_file can contain the following commands. Each initial keyword or number must be followed by white space. The gencat utility ignores any line beginning with a space, a tab, or a $ (dollar sign) character followed by a space, a tab, or a newline character. Thus, you can use these sequences to start comments in your source_file. Blank lines are also ignored. Finally, you can place comments on the same line after the $delset, $quote, $len, or $set commands, because the gencat utility ignores anything following the preceding syntax elements. Inserts text as a message with the identifier message_number. Numbers must be ascending within each set: you can skip a number, but you cannot go back to add a missing number or replace an existing number during a gencat session.
A line beginning with a digit marks a message to be included in the catalog. You can specify any amount of white space between the message ID number and the message text; however, one space or tab character is recommended when the message text is not delimited by quotes. When message text is not quoted, gencat treats additional white space as part of the message. When message text is quoted, gencat ignores all spaces or tabs between the message ID and the first quotation character.
Escape sequences, like those recognized by the C language, can be used in text; these are listed after the commands. Use a \ (backslash) character to continue message text on the following line.
The gencat command does not accept symbolic identifiers. [Compaq] You must run the mkcatdefs command if you want to use symbolic identifiers for messages in your program.
The Escape character \ (backslash) can be used to include the following special characters in the message text: Inserts a newline (NL or LF). Inserts a horizontal tab (HT). Inserts a vertical tab (VT). Performs a backspace function (BS). Inserts a carriage return (CR). Inserts a form feed (FF). Inserts a backslash (\). Inserts the single-byte character associated with the octal value represented by the octal digits ddd. One, two, or three octal digits can be specified; however, you must include leading zeros if the characters following the octal digits are also valid octal digits. For example, the octal value for $ (dollar sign) is 44. To insert $5.00 into a message, use \0445.00, not \445.00, or the 5 will be parsed as part of the octal value. [Compaq] Inserts the character associated with the hexadecimal value represented by the hexadecimal digits. The gencat command inserts a single-byte character when you specify two valid digits (dd) and a double-byte character when you specify four valid digits (dddd). See \ddd for a way to avoid parsing errors when the hexadecimal value precedes an actual digit.
You can also include printf() conversion specifications in messages that are printed by the printf() family of calls in C code or by the printf command in shell scripts.
[Compaq] If you display a message from a shell script with the
command, the only conversion specifications that can be used
in the message are
On successful completion, the
0 (zero); on error, the command returns a value greater than zero. When
returns an error value, no action is taken on any commands,
and an existing catalog is left unchanged.
Diagnostic messages are vendor defined. You can enter the following command to display the messages returned by the gencat command on Tru64 UNIX systems: % dspcat msgfac.cat | grep gencat
To use the $set command in a source file to give a group of messages a set number, enter: $set 10 Communication Error Messages
The following locale environment variables (see
Provides a default value for locale category variables that
are not set. If any of these variables contains an invalid setting, the
command behaves as if none of them were defined.
If set to a non-empty string, overrides values in all locale
Determines the locale for the interpretation in text data
of byte sequences as characters.
Determines the locale used for diagnostic messages.
Determines the location of message catalogs for the processing
Commands: dspcat(1), dspmsg(1), extract(1), mkcatdefs(1), printf(1), runcat(1), strextract(1), strmerge(1), trans(1)
Functions: catclose(3), catgets(3), catopen(3)
Others: i18n_intro(5), l10n_intro(5), iconv_intro(5), standards(5)
Writing Software for the International Market