xref: /freebsd/share/man/man7/environ.7 (revision e627b39baccd1ec9129690167cf5e6d860509655)
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 .
57.Ev BLOCKSIZE
58may be specified in units of a byte by specifying a number,
59in units of a kilobyte by specifying a number followed by ``K'' or
60``k'', in units of a megabyte by specifying a number followed by ``M''
61or ``m'' and in units of a gigabyte by specifying a number followed
62by ``G'' or ``g''.
63Sizes less than 512 bytes or greater than a gigabyte are ignored.
64.It Ev EXINIT
65A startup list of commands read by
66.Xr ex  1  ,
67.Xr edit  1 ,
68and
69.Xr vi  1  .
70.It Ev HOME
71A user's login directory, set by
72.Xr login  1
73from the password file
74.Xr passwd  5  .
75.It Ev LANG
76This variable configures all programs which use
77.Xr setlocale 3
78to use the specified locale.
79.It Ev PATH
80The sequence of directories, separated by colons, searched by
81.Xr csh  1  ,
82.Xr sh  1 ,
83.Xr system  3  ,
84.Xr execvp  3 ,
85etc, when looking for an executable file.
86.Ev PATH
87is set to ``/usr/bin:/bin'' initially by
88.Xr login  1  .
89.It Ev PRINTER
90The name of the default printer to be used by
91.Xr lpr  1  ,
92.Xr lpq  1 ,
93and
94.Xr lprm  1  .
95.It Ev SHELL
96The full pathname of the user's login shell.
97.It Ev TERM
98The kind of terminal for which output is to be prepared.
99This information is used by commands, such as
100.Xr nroff  1
101or
102.Xr plot 1
103which may exploit special terminal capabilities.  See
104.Pa /usr/share/misc/termcap
105.Pq Xr termcap 5
106for a list of terminal types.
107.It Ev TERMCAP
108The string describing the terminal in
109.Ev TERM ,
110or, if
111it begins with a '/', the name of the termcap file.
112See
113.Ev TERMPATH
114below,
115.Xr termcap  5  ,
116and
117.Xr termcap  .
118.It Ev TERMPATH
119A sequence of pathnames of termcap files, separated by colons or spaces,
120which are searched for terminal descriptions in the order listed.  Having
121no
122.Ev TERMPATH
123is equivalent to a
124.Ev TERMPATH
125of
126.Dq Pa $HOME/.termcap:/etc/termcap .
127.Ev TERMPATH
128is ignored if
129.Ev TERMCAP
130contains a full pathname.
131.It Ev TMPDIR
132The directory in which to store temporary files.
133Most applications use either
134.Dq /tmp
135or
136.Dq /var/tmp .
137Setting this variable will make them use another directory.
138.It Ev TZ
139The timezone to use when displaying dates.
140The normal format is a pathname relative to
141.Dq Pa /usr/share/zoneinfo .
142For example, the command
143.Dq env TZ=US/Pacific date
144displays the current time in California.
145See
146.Xr tzset 3
147for more information.
148.It Ev USER
149The login name of the user.
150.El
151.Pp
152Further names may be placed in the environment by the
153.Xr export
154command and
155.Ar name=value
156arguments in
157.Xr sh  1  ,
158or by the
159.Xr setenv
160command if you use
161.Xr csh  1  .
162It is unwise to change certain
163.Xr sh  1
164variables that are frequently exported by
165.Pa .profile
166files, such as
167.Ev MAIL ,
168.Ev PS1 ,
169.Ev PS2 ,
170and
171.Ev IFS ,
172unless you know what you are doing.
173.Sh SEE ALSO
174.Xr csh 1 ,
175.Xr ex 1 ,
176.Xr login 1 ,
177.Xr sh 1 ,
178.Xr execve 2 ,
179.Xr execle 3 ,
180.Xr setlocale 3 ,
181.Xr system 3 ,
182.Xr termcap 3 ,
183.Xr termcap 5
184.Sh HISTORY
185The
186.Nm environ
187manual page appeared in
188.Bx 4.2 .
189