xref: /netbsd-src/share/man/man7/environ.7 (revision 80ba09ce077d00d913c48a5da95f579fc757b7b6)
1*80ba09ceSkre.\"	$NetBSD: environ.7,v 1.27 2017/06/27 01:13:44 kre Exp $
2294d9cc7Sjtc.\"
3294d9cc7Sjtc.\" Copyright (c) 1983, 1990, 1993
4294d9cc7Sjtc.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
14075022b3Sagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
30294d9cc7Sjtc.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
3161f28255Scgd.\"
322302ac37Sroy.Dd January 21, 2011
3361f28255Scgd.Dt ENVIRON 7
345b40cb57Sgarbled.Os
3561f28255Scgd.Sh NAME
3661f28255Scgd.Nm environ
3767aae558Sfair.Nd user process environment
3861f28255Scgd.Sh SYNOPSIS
39d361e188Suwe.Vt extern char ** Ns Dv environ ;
4061f28255Scgd.Sh DESCRIPTION
4161f28255ScgdAn array of strings called the
4267aae558Sfair.Em environment
4361f28255Scgdis made available by
4461f28255Scgd.Xr execve 2
4567aae558Sfairwhen a process begins.
4667aae558SfairBy convention these strings have the form
4761f28255Scgd.Dq Ar name=value .
4861f28255ScgdThe following names are used by various commands:
49d361e188Suwe.Bl -tag -width ".Ev LIBC_DIAGASSERT"
5015c85fb8Skleink.It Ev AUDIOCTLDEVICE
5115c85fb8SkleinkThe name of the audio control device to be used by
5215c85fb8Skleink.Xr audioctl 1 ,
5315c85fb8Skleink.Xr audioplay 1
5415c85fb8Skleinkand
5515c85fb8Skleink.Xr audiorecord 1 .
5615c85fb8Skleink.It Ev AUDIODEVICE
5715c85fb8SkleinkThe name of the audio device to be used by
5815c85fb8Skleink.Xr audioplay 1
5915c85fb8Skleinkand
6015c85fb8Skleink.Xr audiorecord 1 .
61294d9cc7Sjtc.It Ev BLOCKSIZE
62294d9cc7SjtcThe size of the block units used by several commands, most notably
63294d9cc7Sjtc.Xr df 1 ,
64294d9cc7Sjtc.Xr du 1
65294d9cc7Sjtcand
66294d9cc7Sjtc.Xr ls 1 .
6767aae558Sfair.Ev BLOCKSIZE
6867aae558Sfairmay be specified in units of a byte by specifying a number,
691dbed11dSenamiin units of a kilobyte by specifying a number followed by
70d361e188Suwe.Ql K
711dbed11dSenamior
72d361e188Suwe.Ql k ,
731dbed11dSenamiin units of a megabyte by specifying a number followed by
74d361e188Suwe.Ql M
751dbed11dSenamior
76d361e188Suwe.Ql m
771dbed11dSenamiand in units of a gigabyte by specifying a number followed
781dbed11dSenamiby
79d361e188Suwe.Ql G
801dbed11dSenamior
81d361e188Suwe.Ql g .
82294d9cc7SjtcSizes less than 512 bytes or greater than a gigabyte are ignored.
83*80ba09ceSkre.It Ev EDITRC
84*80ba09ceSkreGives the path name of the file used by
85*80ba09ceSkre.Xr editline 7
86*80ba09ceSkrewhen command line editing is enabled in various programs.
87*80ba09ceSkreSee
88*80ba09ceSkre.Xr editrc 5
89*80ba09ceSkrefor information on the format of the file.
9061f28255Scgd.It Ev EXINIT
9161f28255ScgdA startup list of commands read by
9267aae558Sfair.Xr ex 1
9361f28255Scgdand
9461f28255Scgd.Xr vi 1 .
9561f28255Scgd.It Ev HOME
9661f28255ScgdA user's login directory, set by
9761f28255Scgd.Xr login 1
9861f28255Scgdfrom the password file
9961f28255Scgd.Xr passwd 5 .
100951db668Slukem.It Ev LANG
101951db668SlukemDefault for all NLS categories.
102951db668SlukemOnly used if
103951db668Slukem.Ev LC_ALL
104951db668Slukemor the environment variable for a particular NLS category
105951db668Slukemis not provided
106951db668Slukem.Ev ( LC_COLLATE ,
107951db668Slukem.Ev LC_CTYPE ,
108951db668Slukem.Ev LC_MESSAGES ,
109951db668Slukem.Ev LC_MONETARY ,
110951db668Slukem.Ev LC_NUMERIC ,
111951db668Slukemor
112951db668Slukem.Ev LC_TIME ) .
113951db668Slukem.It Ev LC_ALL
114951db668SlukemOverride for all NLS categories.
115951db668SlukemIf set, overrides the values of
116951db668Slukem.Ev LC_COLLATE ,
117951db668Slukem.Ev LC_CTYPE ,
118951db668Slukem.Ev LC_MESSAGES ,
119951db668Slukem.Ev LC_MONETARY ,
120951db668Slukem.Ev LC_NUMERIC ,
121951db668Slukemand
122951db668Slukem.Ev LC_TIME .
123951db668Slukem.It Ev LC_COLLATE
124951db668SlukemNLS string-collation order information.
125951db668Slukem.It Ev LC_CTYPE
126951db668SlukemNLS character classification, case conversion, and other character attributes.
127951db668Slukem.It Ev LC_MESSAGES
128951db668SlukemNLS format for affirmative and negative responses.
129951db668Slukem.It Ev LC_MONETARY
130951db668SlukemNLS rules and symbols for formatting monetary numeric information.
131951db668Slukem.It Ev LC_NUMERIC
132951db668SlukemNLS rules and symbols for formatting nonmonetary numeric information.
133951db668Slukem.It Ev LC_TIME
134951db668SlukemNLS rules and symbols for formatting time and date information.
1359661e3aaSlukem.It Ev LIBC_DIAGASSERT
1369661e3aaSlukemControl how the
1379661e3aaSlukem.Fn _DIAGASSERT
1389661e3aaSlukemmacro (from
1395e015e5eSjoerg.In assert.h )
1409661e3aaSlukembehaves once the assertion is raised.
1419661e3aaSlukemRefer to
1429661e3aaSlukem.Xr _DIAGASSERT 3
1439661e3aaSlukemfor more information.
144f811c80aSkleink.It Ev LOGNAME
145f811c80aSkleinkThe login name of the user.
1469661e3aaSlukem.It Ev MALLOC_OPTIONS
1479661e3aaSlukemControl the behaviour of the
1489661e3aaSlukem.Fn malloc
1499661e3aaSlukemfunction.
1509661e3aaSlukemRefer to
1514af2bdf0Sabhinav.Xr jemalloc 3
1529661e3aaSlukemfor more information.
15315c85fb8Skleink.It Ev MIXERDEVICE
15415c85fb8SkleinkThe name of the audio mixer device to be used by
15515c85fb8Skleink.Xr mixerctl 1 .
1561af451d0Sperry.It Ev PAGER
1571af451d0SperryThe program used for paginating the output of several commands
1581af451d0Sperrysuch as
1591af451d0Sperry.Xr man 1 .
1601af451d0SperryIf null or not set, the standard pagination program
1611af451d0Sperry.Xr more 1
1621af451d0Sperrywill be used.
16361f28255Scgd.It Ev PATH
16461f28255ScgdThe sequence of directories, separated by colons, searched by
16561f28255Scgd.Xr csh 1 ,
16661f28255Scgd.Xr sh 1 ,
16761f28255Scgd.Xr system 3 ,
16861f28255Scgd.Xr execvp 3 ,
16961f28255Scgdetc, when looking for an executable file.
170d361e188Suwe.Ev PATH
171d361e188Suweis set to
172d361e188Suwe.Pp
173d361e188Suwe.Dl /usr/bin:/bin:/usr/pkg/bin:/usr/local/bin
174d361e188Suwe.Pp
1751dbed11dSenamiinitially by
17661f28255Scgd.Xr login 1 .
17761f28255Scgd.It Ev PRINTER
17861f28255ScgdThe name of the default printer to be used by
17961f28255Scgd.Xr lpr 1 ,
18061f28255Scgd.Xr lpq 1 ,
18161f28255Scgdand
18261f28255Scgd.Xr lprm 1 .
1839014bdbcSlukem.It Ev RCMD_CMD
1849014bdbcSlukemWhen using the
1859014bdbcSlukem.Xr rcmd 3
1869014bdbcSlukemfunction, this variable is used as the program to run instead of
1879014bdbcSlukem.Xr rcmd 1 .
18861f28255Scgd.It Ev SHELL
18961f28255ScgdThe full pathname of the user's login shell.
19061f28255Scgd.It Ev TERM
19161f28255ScgdThe kind of terminal for which output is to be prepared.
19261f28255ScgdThis information is used by commands, such as
19361f28255Scgd.Xr nroff 1
1944bdb5662Swiz.\" or
1954bdb5662Swiz.\" .Xr plot 1
19667aae558Sfairwhich may exploit special terminal capabilities.
19767aae558SfairSee
1982302ac37Sroy.Pa /usr/share/misc/terminfo
1992302ac37Sroy.Pq Xr terminfo 5
20061f28255Scgdfor a list of terminal types.
20161f28255Scgd.It Ev TERMCAP
202d361e188SuweThe string describing the terminal in
203d361e188Suwe.Ev TERM ,
204d361e188Suweor, if it begins with a
205d361e188Suwe.Ql / ,
206d361e188Suwethe name of the termcap file.
2072302ac37SroyThis is only checked if
2082302ac37Sroy.Ev TERMINFO
2092302ac37Sroyis not set.
2102302ac37Sroy.It Ev TERMINFO
2112302ac37SroyThe string describing the terminal in
2122302ac37Sroy.Ev TERM ,
2132302ac37Sroyor, if it begins with a
2142302ac37Sroy.Ql / ,
2152302ac37Sroythe name of the terminfo file.
216eefd7784Sblymn.It Ev TIMEFORMAT
217eefd7784SblymnA
218eefd7784Sblymn.Xr strftime 3
219eefd7784Sblymnformat string that may be used by programs such as
220eefd7784Sblymn.Xr dump 8
221eefd7784Sblymnfor formatting timestamps.
222294d9cc7Sjtc.It Ev TMPDIR
223294d9cc7SjtcThe directory in which to store temporary files.
224294d9cc7SjtcMost applications use either
22567aae558Sfair.Pa /tmp
226294d9cc7Sjtcor
22767aae558Sfair.Pa /var/tmp .
228294d9cc7SjtcSetting this variable will make them use another directory.
229294d9cc7Sjtc.It Ev TZ
230294d9cc7SjtcThe timezone to use when displaying dates.
231294d9cc7SjtcThe normal format is a pathname relative to
23267aae558Sfair.Pa /usr/share/zoneinfo .
233294d9cc7SjtcFor example, the command
234d361e188Suwe.Pp
235d361e188Suwe.Dl env TZ=US/Pacific date
236d361e188Suwe.Pp
237294d9cc7Sjtcdisplays the current time in California.
238294d9cc7SjtcSee
239294d9cc7Sjtc.Xr tzset 3
240294d9cc7Sjtcfor more information.
24161f28255Scgd.It Ev USER
24261f28255ScgdThe login name of the user.
243f811c80aSkleinkIt is recommended that portable applications use
244f811c80aSkleink.Ev LOGNAME
245f811c80aSkleinkinstead.
24661f28255Scgd.El
24761f28255Scgd.Pp
24861f28255ScgdFurther names may be placed in the environment by the
24967aae558Sfair.Ic export
25061f28255Scgdcommand and
25161f28255Scgd.Ar name=value
25261f28255Scgdarguments in
25361f28255Scgd.Xr sh 1 ,
25461f28255Scgdor by the
25567aae558Sfair.Ic setenv
25661f28255Scgdcommand if you use
25761f28255Scgd.Xr csh 1 .
25861f28255ScgdIt is unwise to change certain
25961f28255Scgd.Xr sh 1
26061f28255Scgdvariables that are frequently exported by
26161f28255Scgd.Pa .profile
26261f28255Scgdfiles, such as
26361f28255Scgd.Ev MAIL ,
26461f28255Scgd.Ev PS1 ,
26561f28255Scgd.Ev PS2 ,
26661f28255Scgdand
26761f28255Scgd.Ev IFS ,
26861f28255Scgdunless you know what you are doing.
26961f28255Scgd.Sh SEE ALSO
27015c85fb8Skleink.Xr audioctl 1 ,
27115c85fb8Skleink.Xr audioplay 1 ,
27215c85fb8Skleink.Xr audiorecord 1 ,
27361f28255Scgd.Xr csh 1 ,
27461f28255Scgd.Xr ex 1 ,
27561f28255Scgd.Xr login 1 ,
2761af451d0Sperry.Xr man 1 ,
2771af451d0Sperry.Xr more 1 ,
27861f28255Scgd.Xr sh 1 ,
27961f28255Scgd.Xr execve 2 ,
2809661e3aaSlukem.Xr _DIAGASSERT 3 ,
28161f28255Scgd.Xr execle 3 ,
2824af2bdf0Sabhinav.Xr jemalloc 3 ,
2839014bdbcSlukem.Xr rcmd 3 ,
28461f28255Scgd.Xr system 3 ,
28561f28255Scgd.Xr termcap 3 ,
2862302ac37Sroy.Xr terminfo 3 ,
28715c85fb8Skleink.Xr audio 4 ,
288958ea6a0Swiz.Xr terminfo 5 ,
289951db668Slukem.Xr nls 7 ,
290eefd7784Sblymn.Xr dump 8
29161f28255Scgd.Sh HISTORY
29261f28255ScgdThe
29367aae558Sfair.Nm
29461f28255Scgdmanual page appeared in
29561f28255Scgd.Bx 4.2 .
296