xref: /netbsd-src/share/man/man7/environ.7 (revision 80ba09ce077d00d913c48a5da95f579fc757b7b6)
1.\"	$NetBSD: environ.7,v 1.27 2017/06/27 01:13:44 kre 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. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
31.\"
32.Dd January 21, 2011
33.Dt ENVIRON 7
34.Os
35.Sh NAME
36.Nm environ
37.Nd user process environment
38.Sh SYNOPSIS
39.Vt extern char ** Ns Dv environ ;
40.Sh DESCRIPTION
41An array of strings called the
42.Em environment
43is made available by
44.Xr execve 2
45when a process begins.
46By convention these strings have the form
47.Dq Ar name=value .
48The following names are used by various commands:
49.Bl -tag -width ".Ev LIBC_DIAGASSERT"
50.It Ev AUDIOCTLDEVICE
51The name of the audio control device to be used by
52.Xr audioctl 1 ,
53.Xr audioplay 1
54and
55.Xr audiorecord 1 .
56.It Ev AUDIODEVICE
57The name of the audio device to be used by
58.Xr audioplay 1
59and
60.Xr audiorecord 1 .
61.It Ev BLOCKSIZE
62The size of the block units used by several commands, most notably
63.Xr df 1 ,
64.Xr du 1
65and
66.Xr ls 1 .
67.Ev BLOCKSIZE
68may be specified in units of a byte by specifying a number,
69in units of a kilobyte by specifying a number followed by
70.Ql K
71or
72.Ql k ,
73in units of a megabyte by specifying a number followed by
74.Ql M
75or
76.Ql m
77and in units of a gigabyte by specifying a number followed
78by
79.Ql G
80or
81.Ql g .
82Sizes less than 512 bytes or greater than a gigabyte are ignored.
83.It Ev EDITRC
84Gives the path name of the file used by
85.Xr editline 7
86when command line editing is enabled in various programs.
87See
88.Xr editrc 5
89for information on the format of the file.
90.It Ev EXINIT
91A startup list of commands read by
92.Xr ex 1
93and
94.Xr vi 1 .
95.It Ev HOME
96A user's login directory, set by
97.Xr login 1
98from the password file
99.Xr passwd 5 .
100.It Ev LANG
101Default for all NLS categories.
102Only used if
103.Ev LC_ALL
104or the environment variable for a particular NLS category
105is not provided
106.Ev ( LC_COLLATE ,
107.Ev LC_CTYPE ,
108.Ev LC_MESSAGES ,
109.Ev LC_MONETARY ,
110.Ev LC_NUMERIC ,
111or
112.Ev LC_TIME ) .
113.It Ev LC_ALL
114Override for all NLS categories.
115If set, overrides the values of
116.Ev LC_COLLATE ,
117.Ev LC_CTYPE ,
118.Ev LC_MESSAGES ,
119.Ev LC_MONETARY ,
120.Ev LC_NUMERIC ,
121and
122.Ev LC_TIME .
123.It Ev LC_COLLATE
124NLS string-collation order information.
125.It Ev LC_CTYPE
126NLS character classification, case conversion, and other character attributes.
127.It Ev LC_MESSAGES
128NLS format for affirmative and negative responses.
129.It Ev LC_MONETARY
130NLS rules and symbols for formatting monetary numeric information.
131.It Ev LC_NUMERIC
132NLS rules and symbols for formatting nonmonetary numeric information.
133.It Ev LC_TIME
134NLS rules and symbols for formatting time and date information.
135.It Ev LIBC_DIAGASSERT
136Control how the
137.Fn _DIAGASSERT
138macro (from
139.In assert.h )
140behaves once the assertion is raised.
141Refer to
142.Xr _DIAGASSERT 3
143for more information.
144.It Ev LOGNAME
145The login name of the user.
146.It Ev MALLOC_OPTIONS
147Control the behaviour of the
148.Fn malloc
149function.
150Refer to
151.Xr jemalloc 3
152for more information.
153.It Ev MIXERDEVICE
154The name of the audio mixer device to be used by
155.Xr mixerctl 1 .
156.It Ev PAGER
157The program used for paginating the output of several commands
158such as
159.Xr man 1 .
160If null or not set, the standard pagination program
161.Xr more 1
162will be used.
163.It Ev PATH
164The sequence of directories, separated by colons, searched by
165.Xr csh 1 ,
166.Xr sh 1 ,
167.Xr system 3 ,
168.Xr execvp 3 ,
169etc, when looking for an executable file.
170.Ev PATH
171is set to
172.Pp
173.Dl /usr/bin:/bin:/usr/pkg/bin:/usr/local/bin
174.Pp
175initially by
176.Xr login 1 .
177.It Ev PRINTER
178The name of the default printer to be used by
179.Xr lpr 1 ,
180.Xr lpq 1 ,
181and
182.Xr lprm 1 .
183.It Ev RCMD_CMD
184When using the
185.Xr rcmd 3
186function, this variable is used as the program to run instead of
187.Xr rcmd 1 .
188.It Ev SHELL
189The full pathname of the user's login shell.
190.It Ev TERM
191The kind of terminal for which output is to be prepared.
192This information is used by commands, such as
193.Xr nroff 1
194.\" or
195.\" .Xr plot 1
196which may exploit special terminal capabilities.
197See
198.Pa /usr/share/misc/terminfo
199.Pq Xr terminfo 5
200for a list of terminal types.
201.It Ev TERMCAP
202The string describing the terminal in
203.Ev TERM ,
204or, if it begins with a
205.Ql / ,
206the name of the termcap file.
207This is only checked if
208.Ev TERMINFO
209is not set.
210.It Ev TERMINFO
211The string describing the terminal in
212.Ev TERM ,
213or, if it begins with a
214.Ql / ,
215the name of the terminfo file.
216.It Ev TIMEFORMAT
217A
218.Xr strftime 3
219format string that may be used by programs such as
220.Xr dump 8
221for formatting timestamps.
222.It Ev TMPDIR
223The directory in which to store temporary files.
224Most applications use either
225.Pa /tmp
226or
227.Pa /var/tmp .
228Setting this variable will make them use another directory.
229.It Ev TZ
230The timezone to use when displaying dates.
231The normal format is a pathname relative to
232.Pa /usr/share/zoneinfo .
233For example, the command
234.Pp
235.Dl env TZ=US/Pacific date
236.Pp
237displays the current time in California.
238See
239.Xr tzset 3
240for more information.
241.It Ev USER
242The login name of the user.
243It is recommended that portable applications use
244.Ev LOGNAME
245instead.
246.El
247.Pp
248Further names may be placed in the environment by the
249.Ic export
250command and
251.Ar name=value
252arguments in
253.Xr sh 1 ,
254or by the
255.Ic setenv
256command if you use
257.Xr csh 1 .
258It is unwise to change certain
259.Xr sh 1
260variables that are frequently exported by
261.Pa .profile
262files, such as
263.Ev MAIL ,
264.Ev PS1 ,
265.Ev PS2 ,
266and
267.Ev IFS ,
268unless you know what you are doing.
269.Sh SEE ALSO
270.Xr audioctl 1 ,
271.Xr audioplay 1 ,
272.Xr audiorecord 1 ,
273.Xr csh 1 ,
274.Xr ex 1 ,
275.Xr login 1 ,
276.Xr man 1 ,
277.Xr more 1 ,
278.Xr sh 1 ,
279.Xr execve 2 ,
280.Xr _DIAGASSERT 3 ,
281.Xr execle 3 ,
282.Xr jemalloc 3 ,
283.Xr rcmd 3 ,
284.Xr system 3 ,
285.Xr termcap 3 ,
286.Xr terminfo 3 ,
287.Xr audio 4 ,
288.Xr terminfo 5 ,
289.Xr nls 7 ,
290.Xr dump 8
291.Sh HISTORY
292The
293.Nm
294manual page appeared in
295.Bx 4.2 .
296