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