GENCAT(1)                  POSIX Programmer's Manual                 GENCAT(1)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       gencat -- generate a formatted message catalog

SSYYNNOOPPSSIISS
       gencat _c_a_t_f_i_l_e _m_s_g_f_i_l_e...

DDEESSCCRRIIPPTTIIOONN
       The _g_e_n_c_a_t utility shall merge the message text source file _m_s_g_f_i_l_e
       into a formatted message catalog _c_a_t_f_i_l_e.  The file _c_a_t_f_i_l_e shall be
       created if it does not already exist. If _c_a_t_f_i_l_e does exist, its
       messages shall be included in the new _c_a_t_f_i_l_e.  If set and message
       numbers collide, the new message text defined in _m_s_g_f_i_l_e shall replace
       the old message text currently contained in _c_a_t_f_i_l_e.

OOPPTTIIOONNSS
       None.

OOPPEERRAANNDDSS
       The following operands shall be supported:

       _c_a_t_f_i_l_e   A pathname of the formatted message catalog. If ''--'' is
                 specified, standard output shall be used. The format of the
                 message catalog produced is unspecified.

       _m_s_g_f_i_l_e   A pathname of a message text source file. If ''--'' is specified
                 for an instance of _m_s_g_f_i_l_e, standard input shall be used. The
                 format of message text source files is defined in the
                 EXTENDED DESCRIPTION section.

SSTTDDIINN
       The standard input shall not be used unless a _m_s_g_f_i_l_e operand is
       specified as ''--''.

IINNPPUUTT FFIILLEESS
       The input files shall be text files.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       The following environment variables shall affect the execution of
       _g_e_n_c_a_t:

       _L_A_N_G      Provide a default value for the internationalization
                 variables that are unset or null. (See the Base Definitions
                 volume of POSIX.1-2017, _S_e_c_t_i_o_n _8_._2, _I_n_t_e_r_n_a_t_i_o_n_a_l_i_z_a_t_i_o_n
                 _V_a_r_i_a_b_l_e_s for the precedence of internationalization
                 variables used to determine the values of locale categories.)

       _L_C___A_L_L    If set to a non-empty string value, override the values of
                 all the other internationalization variables.

       _L_C___C_T_Y_P_E  Determine the locale for the interpretation of sequences of
                 bytes of text data as characters (for example, single-byte as
                 opposed to multi-byte characters in arguments and input
                 files).

       _L_C___M_E_S_S_A_G_E_S
                 Determine the locale that should be used to affect the format
                 and contents of diagnostic messages written to standard
                 error.

       _N_L_S_P_A_T_H   Determine the location of message catalogs for the processing
                 of _L_C___M_E_S_S_A_G_E_S.

AASSYYNNCCHHRROONNOOUUSS EEVVEENNTTSS
       Default.

SSTTDDOOUUTT
       The standard output shall not be used unless the _c_a_t_f_i_l_e operand is
       specified as ''--''.

SSTTDDEERRRR
       The standard error shall be used only for diagnostic messages.

OOUUTTPPUUTT FFIILLEESS
       None.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
       The content of a message text file shall be in the format defined as
       follows. Note that the fields of a message text source line are
       separated by a single <blank> character. Any other <blank> characters
       are considered to be part of the subsequent field.

       $$sseett _n _c_o_m_m_e_n_t
                 This line specifies the set identifier of the following
                 messages until the next $$sseett or end-of-file appears. The _n
                 denotes the set identifier, which is defined as a number in
                 the range [1, {NL_SETMAX}] (see the _<_l_i_m_i_t_s_._h_> header defined
                 in the Base Definitions volume of POSIX.1-2017). The
                 application shall ensure that set identifiers are presented
                 in ascending order within a single source file, but need not
                 be contiguous. Any string following the set identifier shall
                 be treated as a comment. If no $$sseett directive is specified in
                 a message text source file, all messages shall be located in
                 an implementation-defined default message set NL_SETD (see
                 the _<_n_l___t_y_p_e_s_._h_> header defined in the Base Definitions
                 volume of POSIX.1-2017).

       $$ddeellsseett _n _c_o_m_m_e_n_t
                 This line deletes message set _n from an existing message
                 catalog. The _n denotes the set number [1, {NL_SETMAX}].  Any
                 string following the set number shall be treated as a
                 comment.

       $$ _c_o_m_m_e_n_t A line beginning with ''$$'' followed by a <blank> shall be
                 treated as a comment.

       _m _m_e_s_s_a_g_e_-_t_e_x_t
                 The _m denotes the message identifier, which is defined as a
                 number in the range [1, {NL_MSGMAX}] (see the _<_l_i_m_i_t_s_._h_>
                 header). The _m_e_s_s_a_g_e_-_t_e_x_t shall be stored in the message
                 catalog with the set identifier specified by the last $$sseett
                 directive, and with message identifier _m.  If the _m_e_s_s_a_g_e_-
                 _t_e_x_t is empty, and a <blank> field separator is present, an
                 empty string shall be stored in the message catalog. If a
                 message source line has a message number, but neither a field
                 separator nor _m_e_s_s_a_g_e_-_t_e_x_t, the existing message with that
                 number (if any) shall be deleted from the catalog. The
                 application shall ensure that message identifiers are in
                 ascending order within a single set, but need not be
                 contiguous. The application shall ensure that the length of
                 _m_e_s_s_a_g_e_-_t_e_x_t is in the range [0, {NL_TEXTMAX}] (see the
                 _<_l_i_m_i_t_s_._h_> header).

       $$qquuoottee _n  This line specifies an optional quote character _c, which can
                 be used to surround _m_e_s_s_a_g_e_-_t_e_x_t so that trailing <space>
                 characters or null (empty) messages are visible in a message
                 source line. By default, or if an empty $$qquuoottee directive is
                 supplied, no quoting of _m_e_s_s_a_g_e_-_t_e_x_t shall be recognized.

       Empty lines in a message text source file shall be ignored. The effects
       of lines starting with any character other than those defined above are
       implementation-defined.

       Text strings can contain the special characters and escape sequences
       defined in the following table:

                       +------------------+--------+----------+
                       |   DDeessccrriippttiioonn    | SSyymmbbooll | SSeeqquueennccee |
                       +------------------+--------+----------+
                       |<newline>         | NL(LF) | \n       |
                       |Horizontal-tab    | HT     | \t       |
                       |<vertical-tab>    | VT     | \v       |
                       |<backspace>       | BS     | \b       |
                       |<carriage-return> | CR     | \r       |
                       |<form-feed>       | FF     | \f       |
                       |Backslash         | \      | \\       |
                       |Bit pattern       | ddd    | \ddd     |
                       +------------------+--------+----------+
       The escape sequence ""\\dddddd"" consists of <backslash> followed by one,
       two, or three octal digits, which shall be taken to specify the value
       of the desired character. If the character following a <backslash> is
       not one of those specified, the <backslash> shall be ignored.

       A <backslash> followed by a <newline> is also used to continue a string
       on the following line. Thus, the following two lines describe a single
       message string:


           1 This line continues \
           to the next line

       which shall be equivalent to:


           1 This line continues to the next line

EEXXIITT SSTTAATTUUSS
       The following exit values shall be returned:

        0    Successful completion.

       >0    An error occurred.

CCOONNSSEEQQUUEENNCCEESS OOFF EERRRROORRSS
       Default.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       Message catalogs produced by _g_e_n_c_a_t are binary encoded, meaning that
       their portability cannot be guaranteed between different types of
       machine. Thus, just as C programs need to be recompiled for each type
       of machine, so message catalogs must be recreated via _g_e_n_c_a_t.

EEXXAAMMPPLLEESS
       None.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _i_c_o_n_v

       The Base Definitions volume of POSIX.1-2017, _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t
       _V_a_r_i_a_b_l_e_s, <<lliimmiittss..hh>>, <<nnll__ttyyppeess..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                            GENCAT(1)
