1.\" $NetBSD: environ.7,v 1.17 2003/05/26 10:18:41 lukem 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 May 26, 2003 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 LIBC_DIAGASSERT 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 LIBC_DIAGASSERT 98Control how the 99.Fn _DIAGASSERT 100macro (from 101.Pa \*[Lt]assert.h\*[Gt] ) 102behaves once the assertion is raised. 103Refer to 104.Xr _DIAGASSERT 3 105for more information. 106.It Ev MALLOC_OPTIONS 107Control the behaviour of the 108.Fn malloc 109function. 110Refer to 111.Xr malloc 3 112for more information. 113.It Ev MIXERDEVICE 114The name of the audio mixer device to be used by 115.Xr mixerctl 1 . 116.It Ev PAGER 117The program used for paginating the output of several commands 118such as 119.Xr man 1 . 120If null or not set, the standard pagination program 121.Xr more 1 122will be used. 123.It Ev PATH 124The sequence of directories, separated by colons, searched by 125.Xr csh 1 , 126.Xr sh 1 , 127.Xr system 3 , 128.Xr execvp 3 , 129etc, when looking for an executable file. 130PATH is set to 131.Dq /usr/bin:/bin:/usr/pkg/bin:/usr/local/bin 132initially by 133.Xr login 1 . 134.It Ev PRINTER 135The name of the default printer to be used by 136.Xr lpr 1 , 137.Xr lpq 1 , 138and 139.Xr lprm 1 . 140.It Ev RCMD_CMD 141When using the 142.Xr rcmd 3 143function, this variable is used as the program to run instead of 144.Xr rcmd 1 . 145.It Ev SHELL 146The full pathname of the user's login shell. 147.It Ev TERM 148The kind of terminal for which output is to be prepared. 149This information is used by commands, such as 150.Xr nroff 1 151.\" or 152.\" .Xr plot 1 153which may exploit special terminal capabilities. 154See 155.Pa /usr/share/misc/termcap 156.Pq Xr termcap 5 157for a list of terminal types. 158.It Ev TERMCAP 159The string describing the terminal in TERM, or, if 160it begins with a '/', the name of the termcap file. 161See 162.Ev TERMPATH 163below, 164.Xr termcap 5 , 165and 166.Xr termcap 3 . 167.It Ev TERMPATH 168A sequence of pathnames of termcap files, separated by colons or spaces, 169which are searched for terminal descriptions in the order listed. 170Having no 171.Ev TERMPATH 172is equivalent to a 173.Ev TERMPATH 174of 175.Dq Pa $HOME/.termcap:/usr/share/misc/termcap . 176.Ev TERMPATH 177is ignored if 178.Ev TERMCAP 179contains a full pathname. 180.It Ev TIMEFORMAT 181A 182.Xr strftime 3 183format string that may be used by programs such as 184.Xr dump 8 185for formatting timestamps. 186.It Ev TMPDIR 187The directory in which to store temporary files. 188Most applications use either 189.Pa /tmp 190or 191.Pa /var/tmp . 192Setting this variable will make them use another directory. 193.It Ev TZ 194The timezone to use when displaying dates. 195The normal format is a pathname relative to 196.Pa /usr/share/zoneinfo . 197For example, the command 198.Ic env TZ=US/Pacific date 199displays the current time in California. 200See 201.Xr tzset 3 202for more information. 203.It Ev USER 204The login name of the user. 205.El 206.Pp 207Further names may be placed in the environment by the 208.Ic export 209command and 210.Ar name=value 211arguments in 212.Xr sh 1 , 213or by the 214.Ic setenv 215command if you use 216.Xr csh 1 . 217It is unwise to change certain 218.Xr sh 1 219variables that are frequently exported by 220.Pa .profile 221files, such as 222.Ev MAIL , 223.Ev PS1 , 224.Ev PS2 , 225and 226.Ev IFS , 227unless you know what you are doing. 228.Sh SEE ALSO 229.Xr audioctl 1 , 230.Xr audioplay 1 , 231.Xr audiorecord 1 , 232.Xr csh 1 , 233.Xr ex 1 , 234.Xr login 1 , 235.Xr man 1 , 236.Xr more 1 , 237.Xr sh 1 , 238.Xr execve 2 , 239.Xr _DIAGASSERT 3 , 240.Xr execle 3 , 241.Xr malloc 3 , 242.Xr rcmd 3 , 243.Xr system 3 , 244.Xr termcap 3 , 245.Xr audio 4 , 246.Xr termcap 5 , 247.Xr dump 8 248.Sh HISTORY 249The 250.Nm 251manual page appeared in 252.Bx 4.2 . 253