Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ environ(5P) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(2)

catopen(3P)

ctime(3P)

ctype(3C)

strcoll(3P)

strxfrm(3P)

passwd(4)

profile(4)

timezone(4)

locale(5P)

cat(1)

chrtbl(1M)

date(1)

ed(1)

env(1)

ls(1)

login(1)

nice(1)

nohup(1)

sh(1)

sort(1)

time(1)

vi(1)

colldef(1P)

mm(1)

environ(5P)  —  

NAME

environ − user environment

DESCRIPTION

An array of strings called the “environment” is made available by exec(2) when a process begins. By convention, these strings have the form “name=value.” The following names are used by various ­commands:

HOME The name of the user’s login directory, set by login(1) from the password file (see passwd(4)).

PATH The sequence of directory prefixes that sh(1), time(1), nice(1), nohup(1), etc., apply in searching for a file known by an incomplete path name. The prefixes are separated by colons (:). login(1) sets PATH=:/bin:/usr/bin.  (For more details, see the Execution section of the sh(1) manual entry.)

TERM The kind of terminal for which output is to be prepared.  This information is used by commands, such as mm(1) or vi(1), that may exploit special capabilities of that ­terminal.

TZ Time zone information.  The simplest format is xxxnzzz where xxx is the standard local time zone abbreviation, n is the difference in hours from GMT (Greenwich Mean Time), and zzz is the abbreviation for an alternate time zone (usually the daylight-saving local time zone), if any; for example:

        TZ="PST8PDT7"

The most complex format allows you to specify the difference in hours of the alternate time zone from GMT and the starting day and time and ending day and time for using this alternate time zone.  For example, in 1991 the complex format corresponding to the above simple example is:

        TZ="PST8PDT7,M.4.1.0/02:00,M10.5.0/02:00"

When the above complex format is used, it must be surrounded by double quotes.  For more details, see strftimein ctime(3P) and timezone(4).

When a program or a command begins execution in the POSIX environment, the international environment is set to the C locale, which corresponds to the traditional UNIX System environment.  Programs and commands can change the locale, typically to values specified in the following environment variables. The value of each locale category is determined by searching the following environment variables in order:

LC_ALL

The environment variable corresponding to the locale category

LANG

The value of the first environment variable listed above that exists and is non-null is used.  If it does not identify a supported locale, then the environment is not changed. If none of those environment variables exists and is non-null, then the default locale is used.  For further information, see locale(5P).

LC_ALL This environment variable overrides the setting of the LC_* and LANG environment variables. 

LC_COLLATE This environment variable affects the behavior of the string collation functions strcoll(3P) and strxfrm(3P). For information on how to create data for this category, see colldef(1P).

LC_CTYPE This environment variable specifies the locale to be selected for character classification and conversion information.  The locale is used by commands (such as ls(1), ed(1), sort(1), etc.) to classify characters as alphabetic, printable, uppercase, etc., and to convert characters to uppercase or lowercase (see ctype(3C)).

The locale data for this category is created using the chrtbl(1M) command (see also locale(5P)).

LC_MESSAGES This environment variable defines the strings associated with the affirmative (“y”) and negative (“n”) responses used by selected utilities.  For information on how to create data for this category, see locale(5P).

LC_MONETARY This environment variable specifies the locale to be selected for monetary editing. 

For information on how to create data for this category, see locale(5P) and localeconv(3P).

LC_NUMERIC This environment variable specifies the locale to be selected for numeric editing. This locale defines the decimal delimiter recognized by the atof(3C), gcvt(3C), strtod(3C), scanf(3C), and printf(3C) routines.

For information on how to create data for this category, see locale(5P) and localeconv(3P).

LC_TIME This environment variable specifies the locale to be selected for string formatters in date and time editing.  The locale information is used by the date(1) command and by the strftime routine (see ctime(3P)).

For information on how to create this locale, see locale(5P).

LANG A value to be used for setting the locale if neither LC_ALL nor the environment variables corresponding to the individual locale categories identify a valid locale.

The following environment variable is not a locale category, but it also affects the POSIX international environment:

NLSPATH This is the search path used by catopen(3P) to find message catalogs. It must be defined as a sequence of colon-separated templates. Each template consists of an optional prefix, one or more substitution fields, a file name, and an optional suffix.

Substitution fields consist of a % symbol followed by a single-letter keyword.  The following keywords are currently defined:

%N The value of the name parameter passed to catopen(3P). 
%L The value of $LANG.
%l The language element from $LANG. 
%t The territory element from $LANG. 
%c The codeset element from $LANG. 
%% A single % character.

For example:

LANG=fr_FR
NLSPATH="/lib/locale/ISC/%L/LC_MESSAGES/%N.cat"

defines that catopen(3P) should look for all message catalogs in the directory /lib/locale/ISC/fr_FR/LC_MESSAGES, where the catalog name should be constructed from the name parameter passed to catopen(3P), %N, with the suffix .cat. 

An empty string is substituted if the specified value is not currently defined.  The separators underscore (_) and dot (.)  are not included in %t and %c substitutions. 

Templates defined in NLSPATH are separated by colons (:).  A leading colon or two adjacent colons (::) is equivalent to specifying %N. For example:

NLSPATH=":%N.cat: /lib/locale/ISC/msgcat/%N.cat"

indicates to catopen(3P) that it should look for the requested message catalog first in name, then in name.cat, and lastly in /lib/locale/ISC/msgcat/name.cat. 

The default NLSPATH is /lib/locale/ISC/msgcat/%N. 

Additional names may be placed in the environment by the export command and “name=value” arguments in sh(1), or by exec(2). It is unwise to conflict with certain shell variables that are frequently exported by the .profile files, i.e., MAIL, PS1, PS2, and IFS (see profile(4)).

NOTES

Administrators should note the following:  If you attempt to set the current date to one of the dates that the standard and alternate time zones change (for example, the date that daylight time is starting or ending) and you attempt to set the time to a time in the interval between the end of standard time and the beginning of the alternate time (or the end of the alternate time and the beginning of standard time), the results are unpredictable. 

SEE ALSO

exec(2), catopen(3P), ctime(3P), ctype(3C), strcoll(3P), strxfrm(3P), passwd(4), profile(4), timezone(4), locale(5P).  cat(1), chrtbl(1M), date(1), ed(1), env(1), ls(1), login(1), nice(1), nohup(1), sh(1), sort(1), time(1), vi(1) in the INTERACTIVE UNIX System User’s/System Administrator’s Reference Manual.  colldef(1P) in the International Supplement Guide.  mm(1) in the DOCUMENTER’S WORKBENCH Software Release 2.0 Technical Discussion and Reference Manual. 

\*U  —  Version 1.0

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026