📄 xbd_chap08.html
字号:
</tr><tr valign="top"><td align="left"><p class="tent"><i>GET</i></p></td><td align="left"><p class="tent"><i>LISTER</i></p></td><td align="left"><p class="tent"><i>PAGER</i></p></td><td align="left"><p class="tent"><i>VISUAL</i></p></td></tr><tr valign="top"><td align="left"><p class="tent"><i>GFLAGS</i></p></td><td align="left"><p class="tent"><i>LOGNAME</i></p></td><td align="left"><p class="tent"><i>PATH</i></p></td><td align="left"><p class="tent"><i>YACC</i></p></td></tr><tr valign="top"><td align="left"><p class="tent"><i>HISTFILE</i></p></td><td align="left"><p class="tent"><i>LPDEST</i></p></td><td align="left"><p class="tent"><i>PPID</i></p></td><td align="left"><p class="tent"><i>YFLAGS</i></p></td></tr><tr valign="top"><td align="left"><p class="tent"><i>HISTORY</i></p></td><td align="left"><p class="tent"><i>MAIL</i></p></td><td align="left"><p class="tent"><i>PRINTER</i></p></td><td align="left"><p class="tent"><i> </i></p></td></tr><tr valign="top"><td align="left"><p class="tent"><i>HISTSIZE</i></p></td><td align="left"><p class="tent"><i>MAILCHECK</i></p></td><td align="left"><p class="tent"><i>PROCLANG</i></p></td><td align="left"><p class="tent"><i> </i></p></td></tr><tr valign="top"><td align="left"><p class="tent"><i>HOME</i></p></td><td align="left"><p class="tent"><i>MAILER</i></p></td><td align="left"><p class="tent"><i>PROJECTDIR</i></p></td><td align="left"><p class="tent"><i> </i></p></td></tr></table></center><p>If the variables in the following two sections are present in the environment during the execution of an application or utility,they shall be given the meaning described below. Some are placed into the environment by the implementation at the time the userlogs in; all can be added or changed by the user or any ancestor of the current process. The implementation adds or changesenvironment variables named in IEEE Std 1003.1-2001 only as specified in IEEE Std 1003.1-2001. If they aredefined in the application's environment, the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001 and thefunctions in the System Interfaces volume of IEEE Std 1003.1-2001 assume they have the specified meaning. Conformingapplications shall not set these environment variables to have meanings other than as described. See <a href="../functions/getenv.html"><i>getenv</i>()</a> and the Shell and Utilities volume of IEEE Std 1003.1-2001, <a href="../utilities/xcu_chap02.html#tag_02_12">Section 2.12, Shell Execution Environment</a> for methods of accessing thesevariables.</p><h3><a name="tag_08_02"></a>Internationalization Variables</h3><p>This section describes environment variables that are relevant to the operation of internationalized interfaces described inIEEE Std 1003.1-2001.</p><p>Users may use the following environment variables to announce specific localization requirements to applications. Applicationscan retrieve this information using the <a href="../functions/setlocale.html"><i>setlocale</i>()</a> function to initialize thecorrect behavior of the internationalized interfaces. The descriptions of the internationalization environment variables describethe resulting behavior only when the application locale is initialized in this way. The use of the internationalization variablesby utilities described in the Shell and Utilities volume of IEEE Std 1003.1-2001 is described in the ENVIRONMENTVARIABLES section for those utilities in addition to the global effects described in this section.</p><dl compact><dt><i>LANG</i></dt><dd>This variable shall determine the locale category for native language, local customs, and coded character set in the absence ofthe <i>LC_ALL</i> and other <i>LC_*</i> ( <i>LC_COLLATE ,</i> <i>LC_CTYPE ,</i> <i>LC_MESSAGES ,</i> <i>LC_MONETARY ,</i><i>LC_NUMERIC ,</i> <i>LC_TIME )</i> environment variables. This can be used by applications to determine the language to use forerror messages and instructions, collating sequences, date formats, and so on.</dd><dt><i>LC_ALL</i></dt><dd>This variable shall determine the values for all locale categories. The value of the <i>LC_ALL</i> environment variable hasprecedence over any of the other environment variables starting with <i>LC_</i> ( <i>LC_COLLATE ,</i> <i>LC_CTYPE ,</i><i>LC_MESSAGES ,</i> <i>LC_MONETARY ,</i> <i>LC_NUMERIC ,</i> <i>LC_TIME )</i> and the <i>LANG</i> environment variable.</dd><dt><i>LC_COLLATE</i></dt><dd>This variable shall determine the locale category for character collation. It determines collation information for regularexpressions and sorting, including equivalence classes and multi-character collating elements, in various utilities and the <ahref="../functions/strcoll.html"><i>strcoll</i>()</a> and <a href="../functions/strxfrm.html"><i>strxfrm</i>()</a> functions.Additional semantics of this variable, if any, are implementation-defined.</dd><dt><i>LC_CTYPE</i></dt><dd>This variable shall determine the locale category for character handling functions, such as <a href="../functions/tolower.html"><i>tolower</i>()</a>, <a href="../functions/toupper.html"><i>toupper</i>()</a>, and <a href="../functions/isalpha.html"><i>isalpha</i>()</a>. This environment variable determines the interpretation of sequences of bytes oftext data as characters (for example, single as opposed to multi-byte characters), the classification of characters (for example,alpha, digit, graph), and the behavior of character classes. Additional semantics of this variable, if any, areimplementation-defined.</dd><dt><i>LC_MESSAGES</i></dt><dd>This variable shall determine the locale category for processing affirmative and negative responses and the language andcultural conventions in which messages should be written. <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> It also affects the behavior of the <a href="../functions/catopen.html"><i>catopen</i>()</a> function in determining the message catalog. <img src="../images/opt-end.gif" alt="[Option End]" border="0"> Additional semantics of this variable, if any, are implementation-defined. The language and culturalconventions of diagnostic and informative messages whose format is unspecified by IEEE Std 1003.1-2001 should be affectedby the setting of <i>LC_MESSAGES .</i></dd><dt><i>LC_MONETARY</i></dt><dd>This variable shall determine the locale category for monetary-related numeric formatting information. Additional semantics ofthis variable, if any, are implementation-defined.</dd><dt><i>LC_NUMERIC</i></dt><dd>This variable shall determine the locale category for numeric formatting (for example, thousands separator and radix character)information in various utilities as well as the formatted I/O operations in <a href="../functions/printf.html"><i>printf</i>()</a>and <a href="../functions/scanf.html"><i>scanf</i>()</a> and the string conversion functions in <a href="../functions/strtod.html"><i>strtod</i>()</a>. Additional semantics of this variable, if any, are implementation-defined.</dd><dt><i>LC_TIME</i></dt><dd>This variable shall determine the locale category for date and time formatting information. It affects the behavior of the timefunctions in <a href="../functions/strftime.html"><i>strftime</i>()</a>. Additional semantics of this variable, if any, areimplementation-defined.</dd><dt><i>NLSPATH</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">This variable shall contain a sequence of templates that the <a href="../functions/catopen.html"><i>catopen</i>()</a> function useswhen attempting to locate message catalogs. Each template consists of an optional prefix, one or more conversion specifications, afilename, and an optional suffix. <p>For example:</p><blockquote><pre><tt>NLSPATH="/system/nlslib/%N.cat"</tt></pre></blockquote><p>defines that <a href="../functions/catopen.html"><i>catopen</i>()</a> should look for all message catalogs in the directory<b>/system/nlslib</b>, where the catalog name should be constructed from the <i>name</i> parameter passed to <a href="../functions/catopen.html"><i>catopen</i>()</a> ( <tt>%N</tt> ), with the suffix <b>.cat</b>.</p><p>Conversion specifications consist of a <tt>'%'</tt> symbol, followed by a single-letter keyword. The following keywords arecurrently defined:</p><dl compact><dt><tt>%N</tt></dt><dd>The value of the <i>name</i> parameter passed to <a href="../functions/catopen.html"><i>catopen</i>()</a>.</dd><dt><tt>%L</tt></dt><dd>The value of the <i>LC_MESSAGES</i> category.</dd><dt><tt>%l</tt></dt><dd>The <i>language</i> element from the <i>LC_MESSAGES</i> category.</dd><dt><tt>%t</tt></dt><dd>The <i>territory</i> element from the <i>LC_MESSAGES</i> category.</dd><dt><tt>%c</tt></dt><dd>The <i>codeset</i> element from the <i>LC_MESSAGES</i> category.</dd><dt><tt>%%</tt></dt><dd>A single <tt>'%'</tt> character.</dd></dl><p>An empty string is substituted if the specified value is not currently defined. The separators underscore ( <tt>'_'</tt> ) andperiod ( <tt>'.'</tt> ) are not included in the <tt>%t</tt> and <tt>%c</tt> conversion specifications.</p><p>Templates defined in <i>NLSPATH</i> are separated by colons ( <tt>':'</tt> ). A leading or two adjacent colons <tt>"::"</tt> isequivalent to specifying <tt>%N</tt> . For example:</p><blockquote><pre><tt>NLSPATH=":%N.cat:/nlslib/%L/%N.cat"</tt></pre></blockquote><p>indicates to <a href="../functions/catopen.html"><i>catopen</i>()</a> that it should look for the requested message catalog in<i>name</i>, <i>name</i><b>.cat</b>, and <b>/nlslib/</b><i>category</i><b>/</b><i>name</i><b>.cat</b>, where <i>category</i> is thevalue of the <i>LC_MESSAGES</i> category of the current locale.</p><p>Users should not set the <i>NLSPATH</i> variable unless they have a specific reason to override the default system path. Setting<i>NLSPATH</i> to override the default system path produces undefined results in the standard utilities and in applications withappropriate privileges. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></dd></dl><p>The environment variables <i>LANG ,</i> <i>LC_ALL ,</i> <i>LC_COLLATE ,</i> <i>LC_CTYPE ,</i> <i>LC_MESSAGES ,</i><i>LC_MONETARY ,</i> <i>LC_NUMERIC ,</i> <i>LC_TIME ,</i> <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> and <i>NLSPATH</i> <img src="../images/opt-end.gif" alt="[Option End]" border="0"> provide for the support of internationalized applications. The standard utilities shall make useof these environment variables as described in this section and the individual ENVIRONMENT VARIABLES sections for the utilities. Ifthese variables specify locale categories that are not based upon the same underlying codeset, the results are unspecified.</p><p>The values of locale categories shall be determined by a precedence order; the first condition met below determines thevalue:</p><ol><li><p>If the <i>LC_ALL</i> environment variable is defined and is not null, the value of <i>LC_ALL</i> shall be used.</p></li><li><p>If the <i>LC_*</i> environment variable ( <i>LC_COLLATE ,</i> <i>LC_CTYPE ,</i> <i>LC_MESSAGES ,</i> <i>LC_MONETARY ,</i><i>LC_NUMERIC ,</i> <i>LC_TIME )</i> is defined and is not null, the value of the environment variable shall be used to initializethe category that corresponds to the environment variable.</p></li><li><p>If the <i>LANG</i> environment variable is defined and is not null, the value of the <i>LANG</i> environment variable shall beused.</p></li><li><p>If the <i>LANG</i> environment variable is not set or is set to the empty string, the implementation-defined default localeshall be used.</p></li></ol><p>If the locale value is <tt>"C"</tt> or <tt>"POSIX"</tt> , the POSIX locale shall be used and the standard utilities behave inaccordance with the rules in <a href="xbd_chap07.html#tag_07_02"><i>POSIX Locale</i></a> for the associated category.</p><p>If the locale value begins with a slash, it shall be interpreted as the pathname of a file that was created in the output formatused by the <a href="../utilities/localedef.html"><i>localedef</i></a> utility; see OUTPUT FILES under <a href="../utilities/localedef.html"><i>localedef</i></a>. Referencing such a pathname shall result in that locale being used for theindicated category.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -