xref: /openbsd/share/man/man7/environ.7 (revision ea90ff16)
1*ea90ff16Sjmc.\"	$OpenBSD: environ.7,v 1.14 2005/01/22 23:11:43 jmc Exp $
2df930be7Sderaadt.\"	$NetBSD: environ.7,v 1.4 1995/07/03 19:45:07 jtc Exp $
3df930be7Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1983, 1990, 1993
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
8df930be7Sderaadt.\" modification, are permitted provided that the following conditions
9df930be7Sderaadt.\" are met:
10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
11df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
13df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
14df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
1529295d1cSmillert.\" 3. Neither the name of the University nor the names of its contributors
16df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
17df930be7Sderaadt.\"    without specific prior written permission.
18df930be7Sderaadt.\"
19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29df930be7Sderaadt.\" SUCH DAMAGE.
30df930be7Sderaadt.\"
31df930be7Sderaadt.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
32df930be7Sderaadt.\"
33df930be7Sderaadt.Dd April 19, 1994
34df930be7Sderaadt.Dt ENVIRON 7
35fc8533a3Saaron.Os
36df930be7Sderaadt.Sh NAME
37df930be7Sderaadt.Nm environ
38df930be7Sderaadt.Nd user environment
39df930be7Sderaadt.Sh SYNOPSIS
40df930be7Sderaadt.Ar extern char **environ ;
41df930be7Sderaadt.Sh DESCRIPTION
42df930be7SderaadtAn array of strings called the
43230f84baSaaron.Dq environment
44df930be7Sderaadtis made available by
45df930be7Sderaadt.Xr execve 2
461f53fde1Saaronwhen a process begins.
471f53fde1SaaronBy convention these strings have the form
48d741230eSjmc.Ar name Ns = Ns Ar value .
4998d3582bSaaronThe following variables are recognized by various commands:
50df930be7Sderaadt.Bl -tag -width BLOCKSIZE
51df930be7Sderaadt.It Ev BLOCKSIZE
52df930be7SderaadtThe size of the block units used by several commands, most notably
53df930be7Sderaadt.Xr df 1 ,
5498d3582bSaaron.Xr du 1 ,
55df930be7Sderaadtand
56df930be7Sderaadt.Xr ls 1 .
5798d3582bSaaronMay be specified in units of a byte by specifying a number,
58230f84baSaaronin units of a kilobyte by specifying a number followed by
5998d3582bSaaron.Sq K
60230f84baSaaronor
6198d3582bSaaron.Sq k ,
62230f84baSaaronin units of a megabyte by specifying a number followed by
6398d3582bSaaron.Sq M
64230f84baSaaronor
6598d3582bSaaron.Sq m ,
6698d3582bSaaronor in units of a gigabyte by specifying a number followed
67230f84baSaaronby
6898d3582bSaaron.Sq G
69230f84baSaaronor
7098d3582bSaaron.Sq g .
71df930be7SderaadtSizes less than 512 bytes or greater than a gigabyte are ignored.
72df930be7Sderaadt.It Ev EXINIT
7398d3582bSaaronA list of startup commands read by
7498d3582bSaaron.Xr ex 1
75df930be7Sderaadtand
76df930be7Sderaadt.Xr vi 1 .
77df930be7Sderaadt.It Ev HOME
7854d6e335SaaronThe user's login directory, set by
79df930be7Sderaadt.Xr login 1
80df930be7Sderaadtfrom the password file
81df930be7Sderaadt.Xr passwd 5 .
8254d6e335Saaron.It Ev LOGNAME
8354d6e335SaaronThe login name of the user.
84df930be7Sderaadt.It Ev PATH
85df930be7SderaadtThe sequence of directories, separated by colons, searched by
86df930be7Sderaadt.Xr csh 1 ,
87df930be7Sderaadt.Xr sh 1 ,
8898d3582bSaaron.Xr ksh 1 ,
89df930be7Sderaadt.Xr system 3 ,
90df930be7Sderaadt.Xr execvp 3 ,
91230f84baSaaronetc. when looking for an executable file.
9298d3582bSaaronInitially set to the value of
9398d3582bSaaron.Dv _PATH_DEFPATH
94230f84baSaaronby
9598d3582bSaaron.Xr login 1 ,
9698d3582bSaarontraditionally
9798d3582bSaaron.Pa /usr/bin:/bin ,
9898d3582bSaaronbut expanded to include
9998d3582bSaaron.Pa /usr/sbin ,
10098d3582bSaaron.Pa /sbin ,
10198d3582bSaaron.Pa /usr/X11R6/bin ,
10298d3582bSaaronand
10398d3582bSaaron.Pa /usr/local/bin
10498d3582bSaaronin
10598d3582bSaaron.Ox .
106df930be7Sderaadt.It Ev PRINTER
107df930be7SderaadtThe name of the default printer to be used by
108df930be7Sderaadt.Xr lpq 1 ,
109230f84baSaaron.Xr lpr 1 ,
110df930be7Sderaadtand
111df930be7Sderaadt.Xr lprm 1 .
11298d3582bSaaron.It Ev PWD
11398d3582bSaaronThe current working directory.
114df930be7Sderaadt.It Ev SHELL
115df930be7SderaadtThe full pathname of the user's login shell.
116df930be7Sderaadt.It Ev TERM
117df930be7SderaadtThe kind of terminal for which output is to be prepared.
118230f84baSaaronThis information is used by commands such as
119df930be7Sderaadt.Xr nroff 1
12098d3582bSaaronwhich may exploit special terminal capabilities.
12198d3582bSaaronSee
122df930be7Sderaadt.Pa /usr/share/misc/termcap
123df930be7Sderaadt.Pq Xr termcap 5
124df930be7Sderaadtfor a list of terminal types.
125df930be7Sderaadt.It Ev TERMCAP
12698d3582bSaaronThe string describing the terminal in
12798d3582bSaaron.Ev TERM ,
12898d3582bSaaronor, if it begins with a
12998d3582bSaaron.Ql / ,
130230f84baSaaronthe name of the termcap file.
131df930be7SderaadtSee
132df930be7Sderaadt.Ev TERMPATH
133df930be7Sderaadtbelow,
134df930be7Sderaadt.Xr termcap 5 ,
135df930be7Sderaadtand
1368009c66aSmpech.Xr termcap 3 .
137df930be7Sderaadt.It Ev TERMPATH
138df930be7SderaadtA sequence of pathnames of termcap files, separated by colons or spaces,
1391f53fde1Saaronwhich are searched for terminal descriptions in the order listed.
1401f53fde1SaaronHaving no
141df930be7Sderaadt.Ev TERMPATH
142df930be7Sderaadtis equivalent to a
143df930be7Sderaadt.Ev TERMPATH
144df930be7Sderaadtof
14598d3582bSaaron.Pa $HOME/.termcap:/etc/termcap .
146df930be7Sderaadt.Ev TERMPATH
147df930be7Sderaadtis ignored if
148df930be7Sderaadt.Ev TERMCAP
149df930be7Sderaadtcontains a full pathname.
150df930be7Sderaadt.It Ev TMPDIR
151df930be7SderaadtThe directory in which to store temporary files.
152df930be7SderaadtMost applications use either
153230f84baSaaron.Pa /tmp
154df930be7Sderaadtor
155230f84baSaaron.Pa /var/tmp .
156df930be7SderaadtSetting this variable will make them use another directory.
157df930be7Sderaadt.It Ev TZ
158df930be7SderaadtThe timezone to use when displaying dates.
159df930be7SderaadtThe normal format is a pathname relative to
160230f84baSaaron.Pa /usr/share/zoneinfo .
161df930be7SderaadtFor example, the command
162230f84baSaaron.Ic env TZ=US/Pacific date
163df930be7Sderaadtdisplays the current time in California.
164df930be7SderaadtSee
165df930be7Sderaadt.Xr tzset 3
166df930be7Sderaadtfor more information.
16722b0a796Smillert.It Ev USER
16822b0a796SmillertDeprecated synonym of
16922b0a796Smillert.Ev LOGNAME
17022b0a796Smillert(for backwards compatibility).
171df930be7Sderaadt.El
172df930be7Sderaadt.Pp
173df930be7SderaadtFurther names may be placed in the environment by the
17454d6e335Saaron.Ic export
175df930be7Sderaadtcommand and
176d741230eSjmc.Ar name Ns = Ns Ar value
177df930be7Sderaadtarguments in
178df930be7Sderaadt.Xr sh 1 ,
179df930be7Sderaadtor by the
18098d3582bSaaron.Ic setenv
181df930be7Sderaadtcommand if you use
182df930be7Sderaadt.Xr csh 1 .
183df930be7SderaadtIt is unwise to change certain
184df930be7Sderaadt.Xr sh 1
185df930be7Sderaadtvariables that are frequently exported by
186df930be7Sderaadt.Pa .profile
187df930be7Sderaadtfiles, such as
188df930be7Sderaadt.Ev MAIL ,
189df930be7Sderaadt.Ev PS1 ,
190df930be7Sderaadt.Ev PS2 ,
191df930be7Sderaadtand
192df930be7Sderaadt.Ev IFS ,
193df930be7Sderaadtunless you know what you are doing.
194df930be7Sderaadt.Sh SEE ALSO
195df930be7Sderaadt.Xr csh 1 ,
19698d3582bSaaron.Xr env 1 ,
197df930be7Sderaadt.Xr ex 1 ,
198df930be7Sderaadt.Xr login 1 ,
199df930be7Sderaadt.Xr sh 1 ,
200df930be7Sderaadt.Xr execve 2 ,
201df930be7Sderaadt.Xr execle 3 ,
202*ea90ff16Sjmc.Xr getenv 3 ,
203df930be7Sderaadt.Xr system 3 ,
204df930be7Sderaadt.Xr termcap 3 ,
20598d3582bSaaron.Xr tzset 3 ,
206df930be7Sderaadt.Xr termcap 5
207df930be7Sderaadt.Sh HISTORY
208df930be7SderaadtThe
209230f84baSaaron.Nm
210df930be7Sderaadtmanual page appeared in
211df930be7Sderaadt.Bx 4.2 .
212