ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
-------------------------------------------------------------------------------
environment
PURPOSE
Describes the user environment.
SYNOPSIS
Basic Environment
HOME=path name of home directory
PATH=directory search sequence
TERM=terminal type
TZ=time zone information
LOGNAME=user's login name
USER=user's login name
LOGTTY=user's logged-in terminal line
SHELL=default shell (sh only)
CWD=current working directory
MAIL=user's mailbox
International Character Support Environment
NLIN=path name of the EBCDIC-to-ASCII translation table
NLOUT=path name of the ASCII-to-EBCDIC translation table
LANG=names entire locale
LC_COLLATE=ordering of characters
LC_CTYPE=character examination functions
LC_MONETARY=monetary values
LC_NUMERIC=type of decimal point
LC_TIME=time conversion
LC_MESSAGE=language of error messages
The following environment variables are understood only by executables
generated under the AIX 1.2 or earlier environment. The same functionality can
be achieved by using the environment variables used by setlocale.
NLFILE=path name of environment file
NLCTAB=path name of collating tables
NLLANG=language name
NLCURSYM=currency symbol
NLNUMSEP=triad and decimal separators
NLLDAY=long day names
NLLMONTH=long month names
NLSDAY=short day names
NLSMONTH=short month names
Processed November 7, 1990 ENVIRONMENT(7,F) 1
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
NLTMISC=miscellaneous time strings
NLTSTRS=relative time names
NLTUNITS=time unit names
NLDATE=short date format
NLLDATE=long date format
NLTIME=time format
DESCRIPTION
When a new process begins, the exec system call makes an array of strings
available that have the form name=value. This array of strings is called the
environment. Each name defined by one of the strings is called an environment
variable or shell variable.
When using the sh command interpreter, additional names can be placed in the
environment with the export or env command, or by adding a name=value prefix to
any other command. See the sh command in AIX Operating System Commands
Reference for more information about setting environment variables with shell
commands.
When using the csh command interpreter, additional names can be placed in the
environment with the setenv command. See the csh command in AIX Operating
System Commands Reference for more information about setting environment
variables with shell commands.
Within a program, the getenv subroutine can be used to search the environment
for the value of a given variable. The exec system call allows the entire
environment to be set at one time, usually for a newly started child process.
When creating new environment variables, ensure that their names do not
conflict with those of standard variables used by the shell and other programs,
such as MAIL, PS1, PS2, and IFS.
THE BASIC ENVIRONMENT
When you log in, a number of environment variables are automatically set by the
system before running your login profile, .profile. These variables make up
the basic environment:
CWD Current working directory.
HOME The full path name of the user's login or home directory. The login
program sets this to the name specified in the /etc/passwd file.
LOGNAME User's login name.
LOGTTY User's logged-in terminal.
MAIL User's mailbox.
Processed November 7, 1990 ENVIRONMENT(7,F) 2
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
NLSPATH Contains a sequence of templates which catopen uses when attempting to
locate message catalogs. Each template consists of an optional
prefix, one or more substitution fields, a filename and an optional
suffix.
For example:
NLSPATH="/system/nlslib/%N.cat"
indicates that catopen should look for all message catalogs in the
directory /system/nlslib, where the catalog name should be constructed
from the name parameter passed to catopen, %N, with the suffix .cat.
Substitution fields consist of a % (percent) symbol, followed by a
single letter keyword. The following keywords are currently defined:
%N The value of the name parameter passed to catopen.
%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.
An empty string is substituted if the specified value is not currently
defined. The separators _ and . 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:/nlslib/%L/%N.cat"
indicates to catopen that it should look for the requested message
catalog in name, name.cat, and nlslib/$LANG/name.cat.
PATH The sequence of directories that commands such as sh, time, nice, and
nohup search when looking for a command whose path name is incomplete.
The directory names are separated by colons. PATH is set by the
system login profile, /etc/profile.
SHELL User's shell (sh only).
TERM The type of terminal for which output is to be prepared. Commands
such as mm and tplot use this information to manipulate special
capabilities, if any, of that terminal. The curses, extended curses,
Processed November 7, 1990 ENVIRONMENT(7,F) 3
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
and terminfo subroutines also use the value of TERM. TERM is set by
the getty command to a value defined in /etc/ports.
TZ Time zone information. TZ is set in the system environment file,
/etc/environment.
The value of TZ has the following form (spaces inserted for clarity):
std offset dst offset, rule
The expanded format is as follows:
stdoffset[dst[offset][,start[/time],end[/time]]]
Where:
std and dst Three or more bytes that are the designation for the
standard (std) or summer (dst) time zone. Only std is
required; if dst is missing, then summer time does not
apply in this locale. Upper- and lowercase letters are
explicitly allowed. Any characters except a leading
colon (:), digits, comma (,), minus (-), plus (+), and
ASCII NULL are allowed.
offset Indicates the value one must add to the local time to
arrive at Coordinated Universal Time. The offset has the
following form:
hh[:mm[:ss]]
The minutes (mm) and seconds (ss) are optional. The hour
(hh) shall be required and may be a single digit. The
offset following std shall be required. If no offset
follows dst, summer 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 shall be between 0 and 24, and the minutes (and
seconds) - if present - between 0 and 59. Out of range
values may cause unpredictable behavior. If preceded by
a "-", the time zone shall be east of the Prime Meridian;
otherwise it shall be west (which may be indicated by an
optional preceding "+").
rule Indicates when to change to and from summer time. The
rule has the following form:
date/time,date/time
where the first date describes when the change from
standard to summer time occurs and the second date
describes when the change back happens. Each time field
Processed November 7, 1990 ENVIRONMENT(7,F) 4
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
describes when, in current local time, the change to the
other time is made.
The format of date shall be one of the following:
Jn The Julian day n (1<=n<=365). Leap days shall
not be counted. That is, in all years -
including leap years - February 28 is day 59 and
March 1 is day 60. It is impossible to
explicitly refer to the occasional February 29.
n The zero-based Julian day (0<=n<=365). Leap days
shall be counted, and it is possible to refer to
February 29.
Mm.n.d The d(th) day (0<=d<=6) of week n of month m of
the year (1<=n<=5, 1<=m<=12, where week 5 means
"the last d day in month m" which may occur in
either the fourth or the fifth week). Week 1 is
the first week in which the d(th) day occurs.
Day 0 is Sunday.
The time has the same format as offset except that no
leading sign ("-" or "+") shall be allowed. The default,
if time is not given, shall be 02:00:00.
USER User's login name.
International Character Support Environment
A special set of environment variables defines the international character
support configuration. These environment variables locate configuration
information and tailor input and output forms of dates, times, and monetary
sums according to "national" or local requirements. If an environment variable
value for international character support contains blanks, the value appears in
quotes and blanks cannot separate the equals sign from the variable name or the
value.
The NLgetenv subroutine provides a program with a method to retrieve a value
associated with an international character support environment variable.
Note that when the NLgetenv subroutine is called, the values returned are
associated with internal variables maintained by the setlocale subroutine. If
you do not call setlocale or the front-ends to it (NLgetctab and NLgetfile),
NLgetenv returns the hard-coded C locale default values. If you do call
setlocale, NLgetenv returns the values of the tokens defined in
/usr/lib/mbcs/$LANG (the setlocale subroutine binds the user's language
requirements, as specified by LANG, to a program's locale).
The environment variables NLCTAB and NLFILE are used by the NLgetctab and
NLgetfile subroutines to resolve the environment file path. If you wish to
Processed November 7, 1990 ENVIRONMENT(7,F) 5
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
write portable programs, avoid using these routines which are only front-ends
to setlocale (see "setlocale" and "nl_langinfo").
The environment variables are described as follows:
LANG Identifies the user's requirements as an ASCII character string
in the form:
LANG=language[_territory[.codeset]]
Specific language operation is initiated at program start-up by
calling the setlocale subroutine, binding the user's requirements
specified in LANG to a program's locale as follows:
setlocale (LC_ALL, "");
On AIX systems, this form of a setlocale call is defined to
initialize the program's entire locale from the associated
environment variables. LANG names the program's entire locale
and it provides the necessary defaults if any of the category
variables are not set or set to the empty string.
LC_COLLATE Loads in a new collation table that determines the ordering of
characters. LC_COLLATE affects the behavior of all subroutines
which handle character comparisons.
LC_TYPE Loads in a new ctype table to be used for handling regular
expressions and affects the behavior of all subroutines which
handle characters with typing information.
LC_MONETARY Affects the monetary formatting information, such as language,
territory and codeset, returned by the localeconv subroutine.
LC_NUMERIC Affects the decimal point character for the formatted
input/output functions in scanf and printf and the string
conversion functions in strtod, as well as the non_monetary
information returned by the localeconv subroutine.
LC_TIME Affects the time and weekday functions in the strftime
subroutine.
LC_MESSAGE Specifies the language in which the system error messages are to
be displayed.
The following environment variables are understood only by
executables generated under the AIX 1.2 environment. The same
functionality can be achieved by using the environment variables
used by setlocale.
NLCTAB The path name of the file containing tables that define the
current collating sequence, as produced by the ctab command. The
default path name is:
Processed November 7, 1990 ENVIRONMENT(7,F) 6
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
/etc/nls/ctab/default
NLCURSYM The currency symbol name and placement. The default value is:
:$:L:
NLDATE The environment format string specifying the short form of the
date. This format is used by NLstrtime when the format %D is
encountered. The default is:
MM/DD/YY
NLFILE The path name of a file containing other environment variable
definitions for international character support. NLFILE cannot
be defined within a file that is identified by another NLFILE
definition. There is no default path name.
NLIN The value of NLIN is the path name of the EBCDIC-to-ASCII
translation table. The path name may be an absolute path name or
a partial path name. The path name may also be the name of a
system supplied translation table or a user configured
translation table. For a complete list of system supplied
tables, see /usr/lib/nls/nlin.
NLLANG The environment language label for the set of variables and
environment format strings used for language conventions. The
default value is:
u.s.english
NLLDATE The environment format string specifying the long form of the
date. This form is used by NLstrtime when the formats %lD or %sD
are encountered. The default long date format string is:
mon DD, YYYY
NLLDAY The full (long) names for the days of the week. The default
value is:
Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday
NLLMONTH The full (long) names for the months of the year. The default
value is:
January:February:March:April:May:June:July:\
August:September:October:November:December
NLNUMSEP The numeric triad and decimal separators. The first of the two
separators is the triad separator, which is used to separate
groups of three digits in decimal values. The default value for
NLNUMSEP is:
Processed November 7, 1990 ENVIRONMENT(7,F) 7
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
:,:.:
NLOUT The value of NLOUT is the path name of the ASCII-to-EBCDIC
translation table. The path name may be an absolute path name or
a partial path name. The path name may also be the name of a
system supplied translation table or a user configured
translation table. For a complete list of system supplied
tables, see /usr/lib/nls/nlout.
NLSDAY The short names of the days of the week. Names should be the
same length, and of 5 or fewer characters. The default short
name string is:
Sun:Mon:Tue:Wed:Thu:Fri:Sat
NLSMONTH The short names of the months of the year. Names should be the
same length, and of 5 or fewer characters. The default value is:
Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec
NLTIME The environment format string specifying the format of the time,
that is used by NLstrtime when the formats %T, %sT, or %r are
encountered. The default time format string is:
hh:mm:ss
NLTMISC Miscellaneous strings needed for input and output of date and
time specifications. The default miscellaneous string value is:
at:each:every:on:through:am:pm:zulu
NLTSTRS The relative or informal names needed for input of date and time
specifications to the remind and at commands (see the remind and
at commands in AIX Operating System Commands Reference). The
default informal time string value is:
now:yesterday:tomorrow:noon:midnight:next:weekdays:weekend:today
NLTUNITS The singular and plural forms for all names of units of time,
used for input of date specifications to the at command. The
default string value for units of time is:
"
minute:minutes:hour:hours:day:days:week:weeks:month:months:year:years:min:mins
"
FILES
/etc/environment Sets the basic environment for all processes.
Processed November 7, 1990 ENVIRONMENT(7,F) 8
ENVIRONMENT(7,F) AIX Technical Reference ENVIRONMENT(7,F)
/etc/profile Allows variables to be added to the environment by the
shell.
$HOME/.profile Sets the environment for a specific user's needs.
/etc/nls/ctab/default Sets the international character support environment
(Release 1.2 only).
RELATED INFORMATION
In this book: "exec: execl, execv, execle, execve, execlp, execvp,"
"getenv, NLgetenv," "NLstrtime," "NLtmtime," "termdef," "passwd," "profile,"
"TERM," "setlocale," "nl_langinfo," and "strftime."
The ctab, env, export, login, and sh commands in AIX Operating System Commands
Reference.
"Introduction to International Character Support" in Managing the AIX Operating
System.
AIX Guide to Multibyte Character Set (MBCS) Support.
Processed November 7, 1990 ENVIRONMENT(7,F) 9