xref: /netbsd-src/share/man/man7/environ.7 (revision 4472dbe5e3bd91ef2540bada7a7ca7384627ff9b)
1.\"	$NetBSD: environ.7,v 1.9 2000/03/28 01:25:00 enami 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
74.Dq K
75or
76.Dq k ,
77in units of a megabyte by specifying a number followed by
78.Dq M
79or
80.Dq m
81and in units of a gigabyte by specifying a number followed
82by
83.Dq G
84or
85.Dq g .
86Sizes less than 512 bytes or greater than a gigabyte are ignored.
87.It Ev EXINIT
88A startup list of commands read by
89.Xr ex 1
90and
91.Xr vi 1 .
92.It Ev HOME
93A user's login directory, set by
94.Xr login 1
95from the password file
96.Xr passwd 5 .
97.It Ev MIXERDEVICE
98The name of the audio mixer device to be used by
99.Xr mixerctl 1 .
100.It Ev PATH
101The sequence of directories, separated by colons, searched by
102.Xr csh 1 ,
103.Xr sh 1 ,
104.Xr system 3 ,
105.Xr execvp 3 ,
106etc, when looking for an executable file.
107PATH is set to
108.Dq /usr/bin:/bin:/usr/pkg/bin:/usr/local/bin
109initially by
110.Xr login 1 .
111.It Ev PRINTER
112The name of the default printer to be used by
113.Xr lpr 1 ,
114.Xr lpq 1 ,
115and
116.Xr lprm 1 .
117.It Ev SHELL
118The full pathname of the user's login shell.
119.It Ev TERM
120The kind of terminal for which output is to be prepared.
121This information is used by commands, such as
122.Xr nroff 1
123or
124.Xr plot 1
125which may exploit special terminal capabilities.
126See
127.Pa /usr/share/misc/termcap
128.Pq Xr termcap 5
129for a list of terminal types.
130.It Ev TERMCAP
131The string describing the terminal in TERM, or, if
132it begins with a '/', the name of the termcap file.
133See
134.Ev TERMPATH
135below,
136.Xr termcap 5 ,
137and
138.Xr termcap 3 .
139.It Ev TERMPATH
140A sequence of pathnames of termcap files, separated by colons or spaces,
141which are searched for terminal descriptions in the order listed.
142Having no
143.Ev TERMPATH
144is equivalent to a
145.Ev TERMPATH
146of
147.Dq Pa $HOME/.termcap:/usr/share/misc/termcap .
148.Ev TERMPATH
149is ignored if
150.Ev TERMCAP
151contains a full pathname.
152.It Ev TMPDIR
153The directory in which to store temporary files.
154Most applications use either
155.Pa /tmp
156or
157.Pa /var/tmp .
158Setting this variable will make them use another directory.
159.It Ev TZ
160The timezone to use when displaying dates.
161The normal format is a pathname relative to
162.Pa /usr/share/zoneinfo .
163For example, the command
164.Ic env TZ=US/Pacific date
165displays the current time in California.
166See
167.Xr tzset 3
168for more information.
169.It Ev USER
170The login name of the user.
171.El
172.Pp
173Further names may be placed in the environment by the
174.Ic export
175command and
176.Ar name=value
177arguments in
178.Xr sh 1 ,
179or by the
180.Ic setenv
181command if you use
182.Xr csh 1 .
183It is unwise to change certain
184.Xr sh 1
185variables that are frequently exported by
186.Pa .profile
187files, such as
188.Ev MAIL ,
189.Ev PS1 ,
190.Ev PS2 ,
191and
192.Ev IFS ,
193unless you know what you are doing.
194.Sh SEE ALSO
195.Xr audioctl 1 ,
196.Xr audioplay 1 ,
197.Xr audiorecord 1 ,
198.Xr csh 1 ,
199.Xr ex 1 ,
200.Xr login 1 ,
201.Xr sh 1 ,
202.Xr execve 2 ,
203.Xr execle 3 ,
204.Xr system 3 ,
205.Xr termcap 3 ,
206.Xr audio 4 ,
207.Xr termcap 5
208.Sh HISTORY
209The
210.Nm
211manual page appeared in
212.Bx 4.2 .
213