xref: /original-bsd/share/man/man7/environ.7 (revision 9c5e301d)
1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)environ.7	6.5 (Berkeley) 06/24/90
7.\"
8.Dd
9.Dt ENVIRON 7
10.Os BSD 4.2
11.Sh NAME
12.Nm environ
13.Nd user environment
14.Sh SYNOPSIS
15.Ar extern char **environ ;
16.Sh DESCRIPTION
17An array of strings called the
18.Ar environment
19is made available by
20.Xr execve  2
21when a process begins.  By convention these strings have the form
22.Dq Ar name=value .
23The following names are used by various commands:
24.Tw Fl
25.Tp Ev EXINIT
26A startup list of commands read by
27.Xr ex  1  ,
28.Xr edit  1 ,
29and
30.Xr vi  1  .
31.Tp Ev HOME
32A user's login directory, set by
33.Xr login  1
34from the password file
35.Xr passwd  5  .
36.Tp Ev PATH
37The sequence of directories, separated by colons, searched by
38.Xr csh  1  ,
39.Xr sh  1 ,
40.Xr system  3  ,
41.Xr execvp  3 ,
42etc, when looking for an executable file.
43PATH is set to ``:/usr/ucb:/bin:/usr/bin'' initially by
44.Xr login  1  .
45.Tp Ev PRINTER
46The name of the default printer to be used by
47.Xr lpr  1  ,
48.Xr lpq  1 ,
49and
50.Xr lprm  1  .
51.Tp Ev SHELL
52The full pathname of the user's login shell.
53.Tp Ev TERM
54The kind of terminal for which output is to be prepared.
55This information is used by commands, such as
56.Xr nroff  1
57or
58.Xr plot 1
59which may exploit special terminal capabilities.  See
60.Pa /usr/share/misc/termcap
61.Pq Xr tmercap 5
62for a list of terminal types.
63.Tp Ev TERMCAP
64The string describing the terminal in TERM, or, if
65it begins with a '/', the name of the termcap file.
66See
67.Ev TERMPATH
68below,
69.Xr termcap  5  ,
70and
71.Xr termcap  .
72.Tp Ev TERMPATH
73A sequence of pathnames of termcap files, separated by colons or spaces,
74which are searched for terminal descriptions in the order listed.  Having
75no
76.Ev TERMPATH
77is equivalent to a
78.Ev TERMPATH
79of
80.Dq Pa $HOME/.termcap:/etc/termcap .
81.Ev TERMPATH
82is ignored if
83.Ev TERMCAP
84contains a full pathname.
85.Tp Ev USER
86The login name of the user.
87.Tp
88.Pp
89Further names may be placed in the environment by the
90.Xr export
91command and
92.Ar name=value
93arguments in
94.Xr sh  1  ,
95or by the
96.Xr setenv
97command if you use
98.Xr csh  1  .
99It is unwise to change certain
100.Xr sh  1
101variables that are frequently exported by
102.Pa .profile
103files, such as
104.Ev MAIL ,
105.Ev PS1 ,
106.Ev PS2 ,
107and
108.Ev IFS ,
109unless you know what you are doing.
110.Sh SEE ALSO
111.Xr csh 1 ,
112.Xr ex 1 ,
113.Xr login 1 ,
114.Xr sh 1 ,
115.Xr execve 2 ,
116.Xr execle 3 ,
117.Xr system 3 ,
118.Xr termcap 3 ,
119.Xr termcap 5
120.Sh HISTORY
121.Nm Environ
122appeared in 4.2 BSD.
123