man(1) Manual page archive


     ENVIRON(5)                                             ENVIRON(5)

     NAME
          environ - user environment

     SYNOPSIS
          extern char **environ;

     DESCRIPTION
          An array of strings called the `environment' is made avail-
          able by exec(2) when a process begins.  By convention these
          strings have either the form name=value, defining a vari-
          able, or name(){value}, defining a function; see sh(1). The
          following variables are used by various commands:

          PATH     The sequence of directory prefixes that sh,
                   time(1), nice(1), etc., apply in searching for a
                   file known by an incomplete path name.  The pre-
                   fixes are separated by `:'.  Login(8) sets
                   `PATH=:/bin:/usr/bin'.

          HOME     A user's login directory, set by login(8) from the
                   password file passwd(5).

          TERM     The kind of terminal for which output is to be pre-
                   pared.  This information is used by commands, such
                   as nroff or plot(1), which may exploit special ter-
                   minal capabilities.  Some customary values of TERM
                   are 2621 (HP), 4014 (Tektronix), 5620 (Teletype),
                   and 630 (Teletype).  See described in termcap(5),
                   for a longer list.

          SHELL    The name of the login shell.

          The environment may be queried by getenv(3) or by the `set'
          or `whatis' commands of sh(1). Names may be placed in the
          environment by the `export' command and by name=value argu-
          ments of sh(1). Names may also be placed in the environment
          at the point of an exec(2). It is unwise to conflict with
          certain sh(1) variables that are frequently exported by
          files: MAIL, PS1, PS2, IFS.

     SEE ALSO
          sh(1), printenv(1), exec(2), getenv(3), term(6)

     BUGS
          Function definitions in the environment break some old pro-
          grams, including old shells.