xref: /netbsd-src/share/man/man7/environ.7 (revision e4d7c2e329d54c97e0c0bd3016bbe74f550c3d5e)
1.\"	$NetBSD: environ.7,v 1.8 1999/07/13 14:52:53 kleink Exp $
2.\"
3.\" Copyright (c) 1983, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
35.\"
36.Dd July 13, 1994
37.Dt ENVIRON 7
38.Os
39.Sh NAME
40.Nm environ
41.Nd user process environment
42.Sh SYNOPSIS
43.Ar extern char **environ ;
44.Sh DESCRIPTION
45An array of strings called the
46.Em environment
47is made available by
48.Xr execve 2
49when a process begins.
50By convention these strings have the form
51.Dq Ar name=value .
52The following names are used by various commands:
53.Bl -tag -width AUDIOCTLDEVICE
54.It Ev AUDIOCTLDEVICE
55The name of the audio control device to be used by
56.Xr audioctl 1 ,
57.Xr audioplay 1
58and
59.Xr audiorecord 1 .
60.It Ev AUDIODEVICE
61The name of the audio device to be used by
62.Xr audioplay 1
63and
64.Xr audiorecord 1 .
65.It Ev BLOCKSIZE
66The size of the block units used by several commands, most notably
67.Xr df 1 ,
68.Xr du 1
69and
70.Xr ls 1 .
71.Ev BLOCKSIZE
72may be specified in units of a byte by specifying a number,
73in units of a kilobyte by specifying a number followed by ``K'' or
74``k'', in units of a megabyte by specifying a number followed by ``M''
75or ``m'' and in units of a gigabyte by specifying a number followed
76by ``G'' or ``g''.
77Sizes less than 512 bytes or greater than a gigabyte are ignored.
78.It Ev EXINIT
79A startup list of commands read by
80.Xr ex 1
81and
82.Xr vi 1 .
83.It Ev HOME
84A user's login directory, set by
85.Xr login 1
86from the password file
87.Xr passwd 5 .
88.It Ev MIXERDEVICE
89The name of the audio mixer device to be used by
90.Xr mixerctl 1 .
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.
98PATH is set to ``/usr/bin:/bin'' initially by
99.Xr login 1 .
100.It Ev PRINTER
101The name of the default printer to be used by
102.Xr lpr 1 ,
103.Xr lpq 1 ,
104and
105.Xr lprm 1 .
106.It Ev SHELL
107The full pathname of the user's login shell.
108.It Ev TERM
109The kind of terminal for which output is to be prepared.
110This information is used by commands, such as
111.Xr nroff 1
112or
113.Xr plot 1
114which may exploit special terminal capabilities.
115See
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 TERM, or, if
121it begins with a '/', the name of the termcap file.
122See
123.Ev TERMPATH
124below,
125.Xr termcap 5 ,
126and
127.Xr termcap 3 .
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.
131Having no
132.Ev TERMPATH
133is equivalent to a
134.Ev TERMPATH
135of
136.Dq Pa $HOME/.termcap:/usr/share/misc/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.Pa /usr/share/zoneinfo .
152For example, the command
153.Ic env TZ=US/Pacific 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.Ic export
164command and
165.Ar name=value
166arguments in
167.Xr sh 1 ,
168or by the
169.Ic setenv
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 audioctl 1 ,
185.Xr audioplay 1 ,
186.Xr audiorecord 1 ,
187.Xr csh 1 ,
188.Xr ex 1 ,
189.Xr login 1 ,
190.Xr sh 1 ,
191.Xr execve 2 ,
192.Xr execle 3 ,
193.Xr system 3 ,
194.Xr termcap 3 ,
195.Xr audio 4 ,
196.Xr termcap 5
197.Sh HISTORY
198The
199.Nm
200manual page appeared in
201.Bx 4.2 .
202