environ(5P) INTERACTIVE UNIX System (POSIX) 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
detail, 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), which may exploit spe-
cial 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="EST5EDT"
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 1985 the complex
format corresponding to the above simple example
is:
TZ="EST5:00:00EDT4:00:00;118/2:00:00,300/2:00:00"
When the above complex format is used, it must
be surrounded by double quotes. For more
details, see ctime(3P) and timezone(4).
In the POSIX environment, the format and
interpretation of this environment variable is
slightly different; see strftime(3C).
Rev. 1.1 Page 1
environ(5P) INTERACTIVE UNIX System (POSIX) environ(5P)
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. For each locale category, the corresponding
environment variable value is used. If the environment
variable value is nonexistent, null, or set to an invalid
environment, the locale specified in the LANG environment
variable is used. If neither LANG or the category-specific
environment variable
exists, is non-null, or identifies a valid locale, then the
environment is not changed. For further information, see
locale(5P).
LC_CTYPE In a POSIX environment, this environment vari-
able specifies the locale to be selected for
character classification and conversion informa-
tion. The locale is used by commands (such as
cat(1), ed(1), sort(1), etc.) to classify char-
acters 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_NUMERIC In a POSIX environment, this environment vari-
able 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_MONETARY In a POSIX environment, this environment vari-
able specifies the locale to be selected for
monetary editing, see localeconv(3P).
For information on how to create data for this
category, see locale(5P).
LC_TIME In a POSIX environment, this environment vari-
able specifies the locale to be selected for
string formatters in date and time editing. The
locale information is used by the date(1) com-
mand and by the strftime(3P) routines (see
ctime(3P)).
For information on how to create this locale,
see locale(5P) and cftime(3C).
Rev. 1.1 Page 2
environ(5P) INTERACTIVE UNIX System (POSIX) environ(5P)
LANG A value to be used for setting the locale if no
environment variable corresponding to the indi-
vidual locale categories is set, as defined
above.
In the regular System V environment, the following environ-
ment variables affect the international environment:
CFTIME The default format string to be used by the
date(1) command and the ascftime() and cftime()
routines (see ctime(3P)). If CFTIME is not set
or is null, the default format string specified
in the /lib/cftime/LANGUAGE file (if it exists)
is used in its place (see cftime(4)).
CHRCLASS A value that corresponds to a file in
/lib/chrclass containing character classifica-
tion and conversion information. This informa-
tion is used by commands (such as cat(1), ed(1),
sort(1), etc.) to classify characters as alpha-
betic, printable, uppercase, etc., and to con-
vert characters to uppercase or lowercase.
When a program or command begins execution, the
tables containing this information are initial-
ized based on the value of CHRCLASS. If
CHRCLASS is nonexistent, null, set to a value
for which no file exists in /lib/chrclass, or
errors occur while reading the file, the ASCII
character set is used. During execution, a pro-
gram or command can change the values in these
tables by calling the setchrclass() routine.
For more detail, see ctype(3C).
These tables are created using the chrtbl(1M)
command.
LANGUAGE A language for which a printable file by that
name exists in /lib/cftime. This information is
used by commands (such as date(1), ls(1),
sort(1), etc.) to print date and time informa-
tion in the language specified.
If LANGUAGE is nonexistent, null, set to a value
for which no file exists in /lib/cftime, or
errors occur while reading the file, the last
language requested will be used. (If no
language has been requested, the language
usa_english is assumed.) For a description of
the content of files in /lib/cftime, see
cftime(4).
Further names may be placed in the environment by the export
Rev. 1.1 Page 3
environ(5P) INTERACTIVE UNIX System (POSIX) environ(5P)
command and ``name=value'' arguments in sh(1), or by
exec(2). It is unwise to conflict with certain shell vari-
ables that are frequently exported by .profile files: MAIL,
PS1, PS2, IFS (see profile(4)).
SEE ALSO
exec(2), ctime(3P), ctype(3C), cftime(4), passwd(4), pro-
file(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 Refer-
ence Manual.
mm(1) in the DOCUMENTER'S WORKBENCH Software Release 2.0
Technical Discussion and Reference Manual.
NOTES
References to the cftime(4), ctime(3P), and ctype(3C) manual
entries refer to programming capabilities available begin-
ning with Issue 4.1 of the C Programming Language Utilities.
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 stan-
dard 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.
Rev. 1.1 Page 4