xref: /dragonfly/share/man/man7/environ.7 (revision 0dace59e)
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. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
29.\" $FreeBSD: src/share/man/man7/environ.7,v 1.13.2.4 2001/08/17 13:08:49 ru Exp $
30.\" $DragonFly: src/share/man/man7/environ.7,v 1.4 2007/09/02 19:30:47 swildner Exp $
31.\"
32.Dd April 19, 1994
33.Dt ENVIRON 7
34.Os
35.Sh NAME
36.Nm environ
37.Nd user environment
38.Sh SYNOPSIS
39.Ar extern char **environ ;
40.Sh DESCRIPTION
41An array of strings called the
42.Ar environment
43is made available by
44.Xr execve  2
45when a process begins.  By convention these strings have the form
46.Dq Ar name=value .
47The following names are used by various commands:
48.Bl -tag -width BLOCKSIZE
49.It Ev BLOCKSIZE
50The size of the block units used by several commands, most notably
51.Xr df 1 ,
52.Xr du 1
53and
54.Xr ls 1 .
55.Ev BLOCKSIZE
56may be specified in units of a byte by specifying a number,
57in units of a kilobyte by specifying a number followed by ``K'' or
58``k'', in units of a megabyte by specifying a number followed by ``M''
59or ``m'' and in units of a gigabyte by specifying a number followed
60by ``G'' or ``g''.
61Sizes less than 512 bytes or greater than a gigabyte are ignored.
62.It Ev EDITOR
63Default editor name.
64.It Ev EXINIT
65A startup list of commands read by
66.Xr ex  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 LANG
75This variable configures all programs which use
76.Xr setlocale 3
77to use the specified locale.
78.It Ev MAIL
79The location of the user's
80mailbox instead of the default in /var/mail,
81used by
82.Xr mail  1 ,
83.Xr sh 1 ,
84and many other mailclients.
85.It Ev PAGER
86Default paginator program.  The program specified by this variable is used by
87.Xr mail 1 ,
88.Xr man 1 ,
89.Xr ftp 1 ,
90etc, to display information which is longer than the current display.
91.It Ev PATH
92The sequence of directories, separated by colons, searched by
93.Xr csh  1  ,
94.Xr sh  1 ,
95.Xr system  3  ,
96.Xr execvp  3 ,
97etc, when looking for an executable file.
98.Ev PATH
99is set to ``/usr/bin:/bin'' initially by
100.Xr login  1  .
101.It Ev PRINTER
102The name of the default printer to be used by
103.Xr lpr  1  ,
104.Xr lpq  1 ,
105and
106.Xr lprm  1  .
107.It Ev PWD
108The current directory pathname.
109.It Ev SHELL
110The full pathname of the user's login shell.
111.It Ev TERM
112The kind of terminal for which output is to be prepared.
113This information is used by commands, such as
114.Xr nroff  1
115which may exploit special terminal capabilities.  See
116.Pa /usr/share/misc/termcap
117.Pq Xr termcap 5
118for a list of terminal types.
119.It Ev TERMCAP
120The string describing the terminal in
121.Ev TERM ,
122or, if
123it begins with a '/', the name of the termcap file.
124See
125.Ev TERMPATH
126below, and
127.Xr termcap  5 .
128.It Ev TERMPATH
129A sequence of pathnames of termcap files, separated by colons or spaces,
130which are searched for terminal descriptions in the order listed.  Having
131no
132.Ev TERMPATH
133is equivalent to a
134.Ev TERMPATH
135of
136.Dq Pa $HOME/.termcap:/etc/termcap .
137.Ev TERMPATH
138is ignored if
139.Ev TERMCAP
140contains a full pathname.
141.It Ev TMPDIR
142The directory in which to store temporary files.
143Most applications use either
144.Pa /tmp
145or
146.Pa /var/tmp .
147Setting this variable will make them use another directory.
148.It Ev TZ
149The timezone to use when displaying dates.
150The normal format is a pathname relative to
151.Dq Pa /usr/share/zoneinfo .
152For example, the command
153.Dq env TZ=America/Los_Angeles date
154displays the current time in California.
155See
156.Xr tzset 3
157for more information.
158.It Ev USER
159The login name of the user.
160.El
161.Pp
162Further names may be placed in the environment by the
163.Xr export 1
164command and
165.Ar name=value
166arguments in
167.Xr sh  1  ,
168or by the
169.Xr setenv 1
170command if you use
171.Xr csh  1  .
172It is unwise to change certain
173.Xr sh  1
174variables that are frequently exported by
175.Pa .profile
176files, such as
177.Ev MAIL ,
178.Ev PS1 ,
179.Ev PS2 ,
180and
181.Ev IFS ,
182unless you know what you are doing.
183.Sh SEE ALSO
184.Xr cd 1 ,
185.Xr csh 1 ,
186.Xr ex 1 ,
187.Xr login 1 ,
188.Xr sh 1 ,
189.Xr execve 2 ,
190.Xr execle 3 ,
191.Xr getenv 3 ,
192.Xr setenv 3 ,
193.Xr setlocale 3 ,
194.Xr system 3 ,
195.Xr termcap 3 ,
196.Xr termcap 5
197.Sh HISTORY
198The
199.Nm
200manual page appeared in
201.Bx 4.2 .
202