📄 envvar.html
字号:
<li>If the<i>LANG</i>environment variable is defined and isnot null, the value of the<i>LANG</i>environment variable is used.<p><li>If the<i>LANG</i>environment variable is not set or is setto the empty string, the implementation-dependentdefault locale is used.<p></ol><p>If the locale value is "C" or "POSIX",the POSIX locale is used and thestandard utilities behave in accordance with the rules in<xref href=posixloc><a href="locale.html#tag_005_002">POSIX Locale</a></xref>,for the associated category.<p>If the locale value begins with a slash, it is interpreted as thepathname of a file that was created in the output format used by the<i><a href="../xcu/localedef.html">localedef</a></i>utility; see<b>OUTPUT FILES</b>under<i><a href="../xcu/localedef.html">localedef</a></i>.Referencing such apathname will result in that locale being used for the indicated category.<p>If the locale value has the form:<code><pre><i>language</i><b>[</b><i>_territory</i><b>][</b><i>.codeset</i><b>]</b></code></pre>it refers to an implementation-provided locale, where settings oflanguage, territory and codeset are implementation-dependent.<p><i>LC_COLLATE</i>, <i>LC_CTYPE</i>, <i>LC_MESSAGES</i>, <i>LC_MONETARY</i>, <i>LC_NUMERIC</i>and<i>LC_TIME</i>are defined to accept an additionalfield "@<i>modifier</i> ",which allows the user to selecta specific instance of localisation data within asingle category (for example, for selecting the dictionary as opposed to thecharacter ordering of data).The syntax for these environmentvariables is thus defined as:<code><pre><b>[</b><i>language</i><b>[</b><i>_territory</i><b>][</b><i>.codeset</i><b>][</b>@<i>modifier</i><b>]]</b></code></pre>For example, if a user wanted to interact with the system in French,but required to sort German text files,<i>LANG</i>and<i>LC_COLLATE</i>could be defined as:<code><pre>LANG=Fr_FRLC_COLLATE=De_DE</code></pre><p>This could be extended to select dictionary collation (say) by use ofthe @<i>modifier</i> field; for example:<code><pre>LC_COLLATE=De_DE@dict</code></pre>An implementation may support other formats.<p>If the locale value is not recognised by the implementation, thebehaviour is unspecified.<p>At run time, these values are bound to a program's locale by calling the<i><a href="../xsh/setlocale.html">setlocale()</a></i>function.<p>Additional criteria for determining a valid locale name areimplementation-dependent.<h3><a name = "tag_002_003"> </a>Other Environment Variables</h3><dl compact><dt><i>COLUMNS</i><dd><index term="COLUMNS, "></index>A decimal integer > 0 used to indicatethe user's preferred widthin column positions for the terminal screen or window.(See<xref href=colpos><a href="glossary.html#tag_004_000_057">column position</a></xref>.)If this variable is unset or null,the implementation determines the number ofcolumns, appropriate for the terminal or window,in an unspecified manner.When<i>COLUMNS</i>is set, any terminal-width information implied by<i>TERM</i>will be overridden.Users and portable applications should not set<i>COLUMNS</i>unless they wish to override the system selectionand produce output unrelated to the terminal characteristics.The default value for the number of column positions is unspecifiedbecause historical implementations use different methodsto determine values corresponding to thesize of the screen in which the utility is run.This size is typically known to the implementationthrough the value of<i>TERM</i>or by more elaborate methods such as extensions to the<i><a href="../xcu/stty.html">stty</a></i>utility, or knowledge of how the user is dynamically resizing windowson a bit-mapped display terminal.Users should not need to set this variable in theenvironment unless there is a specific reason tooverride the implementation's default behaviour,such as to display data in an area arbitrarily smallerthan the terminal or window.<dt><i>DATEMSK</i><dd><index term="DATEMSK, "></index>Indicates the pathname of the template file used by<i><a href="../xsh/getdate.html">getdate()</a></i>.<dt><i>HOME</i><dd><index term="HOME, "></index>The system will initialise this variableat the time of login to bea pathname of the user's home directory.See<i><a href="../xsh/pwd.h.html"><pwd.h></a></i>.<dt><i>LINES</i><dd><index term="LINES, "></index>A decimal integer > 0 used to indicatethe user's preferred number of lines ona page or the vertical screen orwindow size in lines.A line in this case is a vertical measure large enoughto hold the tallest character in the character set being displayed.If this variable is unset or null,the implementation determines the number oflines, appropriate for the terminal or window (size,terminal baud rate, and so forth),in an unspecified manner.When<i>LINES</i>is set, any terminal-height information implied by<i>TERM</i>will be overridden.Users and portable applications should not set<i>LINES</i>unless they wish to override the system selectionand produce output unrelated to the terminal characteristics.The default value for the number of lines is unspecifiedbecause historical implementations use different methodsto determine values corresponding to thesize of the screen in which the utility is run.This size is typically known to the implementationthrough the value of<i>TERM</i>or by more elaborate methods such as extensions to the<i><a href="../xcu/stty.html">stty</a></i>utility, or knowledge of how the user is dynamically resizing windowson a bit-mapped display terminal.Users should not need to set this variable in theenvironment unless there is a specific reason tooverride the implementation's default behaviour,such as to display data in an area arbitrarily smallerthan the terminal or window.<dt><i>LOGNAME</i><dd><index term="LOGNAME, "></index>The system will initialise this variableat the time of login to bethe user's login name.See<i><a href="../xsh/pwd.h.html"><pwd.h></a></i>.For a value of<i>LOGNAME</i>to be portable across implementationsof the ISO POSIX-1 standard, the value should be composed of characters from theportable filename character set.<dt><i>MSGVERB</i><dd><index term="MSGVERB, "></index>Describes which message components are to be used in writing messages by<i><a href="../xsh/fmtmsg.html">fmtmsg()</a></i>.<dt><i>PATH</i><dd><index term="PATH, "></index>The sequence of path prefixesthat certain functionsand utilitiesapply in searching for an executable file known only by a filename.The prefixes are separated by a colon (:)When a non-zero-length prefix is applied to this filename,a slash is inserted between the prefix and the filename.A zero-length prefix is a legacy featurethat indicates the current working directory.It appears as two adjacent colons (::),as an initial colon preceding the rest of the list, or as a trailingcolon following the rest of the list.A portable application mustuse an actual pathname (such as .)to represent the current working directory in<i>PATH</i>.The list is searched from beginning to end,applying the filename to each prefix,until an executable filewith the specified name and appropriate execution permissions is found.If the pathname being sought contains a slash, the search throughthe path prefixes will not be performed.If the pathname begins with a slash, the specified path isresolved (see<xref href=pathres><a href="glossary.html#tag_004_000_198">pathname resolution</a></xref>).If<i>PATH</i>is unset or is set to null, the path search is implementation-dependent.<dt><i>SHELL</i><dd><index term="SHELL, "></index>A pathname of the user's preferred command language interpreter.If this interpreter does not conform to theXSI Shell Command Language in the <b>XCU</b> specification, <a href="../xcu/chap2.html"><b>Shell Command Language</b> </a>,utilities may behave differently from those described in this specification set.<dt><i>TMPDIR</i><dd><index term="TMPDIR, "></index>A pathname of a directory made available for programsthat need a place to create temporary files.<dt><i>TERM</i><dd><index term="TERM, "></index>The terminal type for which output is to be prepared.Thisinformation is used by utilities and application programs wishingto exploit special capabilities specific to a terminal.The format and allowable values of this environment variable are unspecified.<dt><i>TZ</i><dd><index term="TZ, "></index>Timezone information.The contents of the environment variable named<i>TZ</i>are used by the<i><a href="../xsh/ctime.html">ctime()</a></i>,<i><a href="../xsh/localtime.html">localtime()</a></i>,<i><a href="../xsh/strftime.html">strftime()</a></i>and<i><a href="../xsh/mktime.html">mktime()</a></i>functions, and by various utilities,to override the default timezone.The value of<i>TZ</i>has one of the two forms (spaces insertedfor clarity):<code><pre>:<i>characters</i></code></pre>or:<code><pre><i>std offset dst offset</i>, <i>rule</i></code></pre>If<i>TZ</i>is of the first format (that is, if the first characteris a colon), the characters following the colon arehandled in an implementation-dependent manner.The expanded format (for all<i>TZ</i>swhose value does not havea colon as the first character) is as follows:<code><pre><i>stdoffset</i><b>[</b><i>dst</i><b>[</b><i>offset</i><b>][</b>,<i>start</i><b>[</b>/<i>time</i><b>]</b>,<i>end</i><b>[</b>/<i>time</i><b>]]]</b></code></pre>Where:<dl compact><dt><i>std</i> and <i>dst</i><dd><br>Indicates no less than three, nor more than{TZNAME_MAX},bytes that are the designation for the standard( <i>std</i> )or the alternative( <i>dst</i>- such as Daylight Savings Time) timezone.Only<i>std</i>is required; if<i>dst</i>is missing,then the alternative time does not apply in this locale.Upper- and lower-case letters are explicitly allowed.Any graphic characters except a leading colon(:)or digits,the comma(,),the minus(-),the plus(+),and the null character are permittedto appear in these fields,but their meaning is unspecified.<dt><i>offset</i><dd>Indicates the value one must add to the local time to arrive atCoordinated Universal Time.The<i>offset</i>has the form:<pre><dl compact><dt> <dd><i>hh</i><b>[</b>:<i>mm</i><b>[</b>:<i>ss</i><b>]</b>]</dl></pre>The minutes(<i>mm</i>)and seconds(<i>ss</i>)are optional.The hour(<i>hh</i>)is required and may be a single digit.The<i>offset</i>following<i>std</i>is required.If no<i>offset</i>follows<i>dst</i>,the alternative time is assumed to be one hour ahead of standard time.One or more digits may be used;the value is always interpreted as a decimal number.The hour is between zero and 24,and the minutes (and seconds) if present betweenzero and 59.Use of values outside these ranges causes undefined behaviour.If preceded by a -, the timezone is east of the Prime Meridian;otherwise it is west (which may be indicated by an optional preceding +).<p><dt><i>rule</i><dd>Indicates when to change to and back from the alternative time.The<i>rule</i>has the form:<code><pre><i>date</i><b>[</b>/<i>time</i><b>]</b>,<i>date</i><b>[</b>/<i>time</i><b>]</b></code></pre>where the first<i>date</i>describes when the change from standard to alternative time occursand the second<i>date</i>describes when the change back happens.Each<i>time</i>field describes when, in current local time, the change tothe other time is made.<p>The format of<i>date</i>is one of the following:<dl compact><dt>J<i>n</i><dd>The Julian day<i>n</i>(1 <i>n</i> 365).Leap days are not counted.That is, in all years including leap years February 28 is day59 and March 1 is day 60.It is impossible to refer explicitly to the occasional February 29.<dt><i>n</i><dd>The zero-based Julian day(0 <i>n</i> 365).Leap days are counted, and it is possible to refer to February 29.<dt>M<i>m</i>.<i>n</i>.<i>d</i><dd><br>The<i>d</i><sup><small>th</small></sup>day (0 <i>d</i> 6) of week<i>n</i>of month<i>m</i>of the year(1 <i>n</i> 5, 1 <i>m</i> 12, where week 5 means "the last<i>d</i>day in month<i>m</i>"which may occur in either the fourth or the fifth week).Week 1 is the first week in which theday occurs.Day zero is Sunday.</dl><p>The<i>time</i>has the same format as<i>offset</i>except that no leading sign (- or +) is allowed.The default, if<i>time</i>is not given, is 02:00:00.<p></dl><p></dl></blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -