xref: /freebsd/share/man/man7/environ.7 (revision 17ee9d00bc1ae1e598c38f25826f861e4bc6c3ce)
1.\" Copyright (c) 1983, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
33.\"
34.Dd April 19, 1994
35.Dt ENVIRON 7
36.Os BSD 4.2
37.Sh NAME
38.Nm environ
39.Nd user environment
40.Sh SYNOPSIS
41.Ar extern char **environ ;
42.Sh DESCRIPTION
43An array of strings called the
44.Ar environment
45is made available by
46.Xr execve  2
47when a process begins.  By convention these strings have the form
48.Dq Ar name=value .
49The following names are used by various commands:
50.Bl -tag -width BLOCKSIZE
51.It Ev BLOCKSIZE
52The size of the block units used by several commands, most notably
53.Xr df 1 ,
54.Xr du 1
55and
56.Xr ls 1 .
57BLOCKSIZE may be specified in units of a byte by specifying a number,
58in units of a kilobyte by specifying a number followed by ``K'' or
59``k'', in units of a megabyte by specifying a number followed by ``M''
60or ``m'' and in units of a gigabyte by specifying a number followed
61by ``G'' or ``g''.
62Sizes less than 512 bytes or greater than a gigabyte are ignored.
63.It Ev EXINIT
64A startup list of commands read by
65.Xr ex  1  ,
66.Xr edit  1 ,
67and
68.Xr vi  1  .
69.It Ev HOME
70A user's login directory, set by
71.Xr login  1
72from the password file
73.Xr passwd  5  .
74.It Ev PATH
75The sequence of directories, separated by colons, searched by
76.Xr csh  1  ,
77.Xr sh  1 ,
78.Xr system  3  ,
79.Xr execvp  3 ,
80etc, when looking for an executable file.
81PATH is set to ``:/usr/ucb:/bin:/usr/bin'' initially by
82.Xr login  1  .
83.It Ev PRINTER
84The name of the default printer to be used by
85.Xr lpr  1  ,
86.Xr lpq  1 ,
87and
88.Xr lprm  1  .
89.It Ev SHELL
90The full pathname of the user's login shell.
91.It Ev TERM
92The kind of terminal for which output is to be prepared.
93This information is used by commands, such as
94.Xr nroff  1
95or
96.Xr plot 1
97which may exploit special terminal capabilities.  See
98.Pa /usr/share/misc/termcap
99.Pq Xr termcap 5
100for a list of terminal types.
101.It Ev TERMCAP
102The string describing the terminal in TERM, or, if
103it begins with a '/', the name of the termcap file.
104See
105.Ev TERMPATH
106below,
107.Xr termcap  5  ,
108and
109.Xr termcap  .
110.It Ev TERMPATH
111A sequence of pathnames of termcap files, separated by colons or spaces,
112which are searched for terminal descriptions in the order listed.  Having
113no
114.Ev TERMPATH
115is equivalent to a
116.Ev TERMPATH
117of
118.Dq Pa $HOME/.termcap:/etc/termcap .
119.Ev TERMPATH
120is ignored if
121.Ev TERMCAP
122contains a full pathname.
123.It Ev TMPDIR
124The directory in which to store temporary files.
125Most applications use either
126.Dq /tmp
127or
128.Dq /var/tmp .
129Setting this variable will make them use another directory.
130.It Ev TZ
131The timezone to use when displaying dates.
132The normal format is a pathname relative to
133.Dq /usr/share/zoneinfo .
134For example, the command
135.Dq env TZ=US/Pacific date
136displays the current time in California.
137See
138.Xr tzset 3
139for more information.
140.It Ev USER
141The login name of the user.
142.El
143.Pp
144Further names may be placed in the environment by the
145.Xr export
146command and
147.Ar name=value
148arguments in
149.Xr sh  1  ,
150or by the
151.Xr setenv
152command if you use
153.Xr csh  1  .
154It is unwise to change certain
155.Xr sh  1
156variables that are frequently exported by
157.Pa .profile
158files, such as
159.Ev MAIL ,
160.Ev PS1 ,
161.Ev PS2 ,
162and
163.Ev IFS ,
164unless you know what you are doing.
165.Sh SEE ALSO
166.Xr csh 1 ,
167.Xr ex 1 ,
168.Xr login 1 ,
169.Xr sh 1 ,
170.Xr execve 2 ,
171.Xr execle 3 ,
172.Xr system 3 ,
173.Xr termcap 3 ,
174.Xr termcap 5
175.Sh HISTORY
176The
177.Nm environ
178manual page appeared in
179.Bx 4.2 .
180