Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

ex(1)

login(1)

sh(1)

execve(2)

system(3)

termcap(3x)

passwd(5)

termcap(5)

environ(7)

Name

environ − user environment

Syntax

extern char **environ;

Description

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

PATH The sequence of directory prefixes that sh, time, and nice apply in searching for a file known by an incomplete path name. The prefixes are separated by a colon (:). The login() command sets PATH=:/usr/ucb:/bin:/usr/bin.

HOME A user’s login directory, set by login from the password file passwd.

TERM The kind of terminal for which output is to be prepared.  This information is used by commands, such as nroff or plot, which may exploit special terminal capabilities.  See /etc/termcap in termcap() for a list of terminal types.

SHELL The file name of the user’s login shell. 

TERMCAP
The string describing the terminal in TERM or the name of the termcap file.  For further information, see termcap() and termcap(.).

EXINIT A startup list of commands read by ex, edit, and vi.

USER The login name of the user. 

PRINTER The name of the default printer to be used by lpr, lpq, and lprm.

Further names may be placed in the environment by the export command and “name=value” arguments in sh, or by the setenv command if you use csh. Arguments can also be placed in the environment at the point of an execve. It is unwise to conflict with certain sh variables that are frequently exported by .profile files: MAIL, PS1, PS2, and IFS.

See Also

csh(1), ex(1), login(1), sh(1), execve(2), system(3), termcap(3x), passwd(5), termcap(5)

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