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