xref: /freebsd/share/man/man7/environ.7 (revision 6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1)
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.\"	$Id: environ.7,v 1.10 1997/03/08 14:41:44 wosch Exp $
34.\"
35.Dd April 19, 1994
36.Dt ENVIRON 7
37.Os BSD 4.2
38.Sh NAME
39.Nm environ
40.Nd user environment
41.Sh SYNOPSIS
42.Ar extern char **environ ;
43.Sh DESCRIPTION
44An array of strings called the
45.Ar environment
46is made available by
47.Xr execve  2
48when a process begins.  By convention these strings have the form
49.Dq Ar name=value .
50The following names are used by various commands:
51.Bl -tag -width BLOCKSIZE
52.It Ev BLOCKSIZE
53The size of the block units used by several commands, most notably
54.Xr df 1 ,
55.Xr du 1
56and
57.Xr ls 1 .
58.Ev BLOCKSIZE
59may be specified in units of a byte by specifying a number,
60in units of a kilobyte by specifying a number followed by ``K'' or
61``k'', in units of a megabyte by specifying a number followed by ``M''
62or ``m'' and in units of a gigabyte by specifying a number followed
63by ``G'' or ``g''.
64Sizes less than 512 bytes or greater than a gigabyte are ignored.
65.It Ev EXINIT
66A startup list of commands read by
67.Xr ex  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 MAIL
80The location of the user's
81mailbox instead of the default in /var/mail,
82used by
83.Xr mail  1 ,
84.Xr sh 1 ,
85and many other mailclients.
86.It Ev PATH
87The sequence of directories, separated by colons, searched by
88.Xr csh  1  ,
89.Xr sh  1 ,
90.Xr system  3  ,
91.Xr execvp  3 ,
92etc, when looking for an executable file.
93.Ev PATH
94is set to ``/usr/bin:/bin'' initially by
95.Xr login  1  .
96.It Ev PRINTER
97The name of the default printer to be used by
98.Xr lpr  1  ,
99.Xr lpq  1 ,
100and
101.Xr lprm  1  .
102.It Ev SHELL
103The full pathname of the user's login shell.
104.It Ev TERM
105The kind of terminal for which output is to be prepared.
106This information is used by commands, such as
107.Xr nroff  1
108or
109.Xr plot 1
110which may exploit special terminal capabilities.  See
111.Pa /usr/share/misc/termcap
112.Pq Xr termcap 5
113for a list of terminal types.
114.It Ev TERMCAP
115The string describing the terminal in
116.Ev TERM ,
117or, if
118it begins with a '/', the name of the termcap file.
119See
120.Ev TERMPATH
121below, and
122.Xr termcap  5 .
123.It Ev TERMPATH
124A sequence of pathnames of termcap files, separated by colons or spaces,
125which are searched for terminal descriptions in the order listed.  Having
126no
127.Ev TERMPATH
128is equivalent to a
129.Ev TERMPATH
130of
131.Dq Pa $HOME/.termcap:/etc/termcap .
132.Ev TERMPATH
133is ignored if
134.Ev TERMCAP
135contains a full pathname.
136.It Ev TMPDIR
137The directory in which to store temporary files.
138Most applications use either
139.Dq /tmp
140or
141.Dq /var/tmp .
142Setting this variable will make them use another directory.
143.It Ev TZ
144The timezone to use when displaying dates.
145The normal format is a pathname relative to
146.Dq Pa /usr/share/zoneinfo .
147For example, the command
148.Dq env TZ=America/Los_Angeles date
149displays the current time in California.
150See
151.Xr tzset 3
152for more information.
153.It Ev USER
154The login name of the user.
155.El
156.Pp
157Further names may be placed in the environment by the
158.Xr export
159command and
160.Ar name=value
161arguments in
162.Xr sh  1  ,
163or by the
164.Xr setenv
165command if you use
166.Xr csh  1  .
167It is unwise to change certain
168.Xr sh  1
169variables that are frequently exported by
170.Pa .profile
171files, such as
172.Ev MAIL ,
173.Ev PS1 ,
174.Ev PS2 ,
175and
176.Ev IFS ,
177unless you know what you are doing.
178.Sh SEE ALSO
179.Xr cd 1 ,
180.Xr csh 1 ,
181.Xr ex 1 ,
182.Xr login 1 ,
183.Xr sh 1 ,
184.Xr execve 2 ,
185.Xr execle 3 ,
186.Xr setlocale 3 ,
187.Xr system 3 ,
188.Xr termcap 3 ,
189.Xr termcap 5
190.Sh HISTORY
191The
192.Nm environ
193manual page appeared in
194.Bx 4.2 .
195