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