1.\" Copyright (c) 1983, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)environ.7 8.3 (Berkeley) 4/19/94 33.\" 34.Dd April 19, 1994 35.Dt ENVIRON 7 36.Os BSD 4.2 37.Sh NAME 38.Nm environ 39.Nd user environment 40.Sh SYNOPSIS 41.Ar extern char **environ ; 42.Sh DESCRIPTION 43An array of strings called the 44.Ar environment 45is made available by 46.Xr execve 2 47when a process begins. By convention these strings have the form 48.Dq Ar name=value . 49The following names are used by various commands: 50.Bl -tag -width ENABLE_STARTUP_LOCALE 51.It Ev BLOCKSIZE 52The size of the block units used by several commands, most notably 53.Xr df 1 , 54.Xr du 1 55and 56.Xr ls 1 . 57BLOCKSIZE may be specified in units of a byte by specifying a number, 58in units of a kilobyte by specifying a number followed by ``K'' or 59``k'', in units of a megabyte by specifying a number followed by ``M'' 60or ``m'' and in units of a gigabyte by specifying a number followed 61by ``G'' or ``g''. 62Sizes less than 512 bytes or greater than a gigabyte are ignored. 63.It Ev ENABLE_STARTUP_LOCALE 64If this variable is set (value ignored), call 65.Xr \%setlocale 3 66at program startup automatically (for 8-bits wide locales only), configuring 67program by 68.Ev LANG 69variable or 70.Ev LC_* 71variables at very beginning. 72.It Ev EXINIT 73A startup list of commands read by 74.Xr ex 1 , 75.Xr edit 1 , 76and 77.Xr vi 1 . 78.It Ev HOME 79A user's login directory, set by 80.Xr login 1 81from the password file 82.Xr passwd 5 . 83.It Ev PATH 84The sequence of directories, separated by colons, searched by 85.Xr csh 1 , 86.Xr sh 1 , 87.Xr system 3 , 88.Xr execvp 3 , 89etc, when looking for an executable file. 90PATH is set to ``/usr/bin:/bin'' initially by 91.Xr login 1 . 92.It Ev PRINTER 93The name of the default printer to be used by 94.Xr lpr 1 , 95.Xr lpq 1 , 96and 97.Xr lprm 1 . 98.It Ev SHELL 99The full pathname of the user's login shell. 100.It Ev TERM 101The kind of terminal for which output is to be prepared. 102This information is used by commands, such as 103.Xr nroff 1 104or 105.Xr plot 1 106which may exploit special terminal capabilities. See 107.Pa /usr/share/misc/termcap 108.Pq Xr termcap 5 109for a list of terminal types. 110.It Ev TERMCAP 111The string describing the terminal in TERM, or, if 112it begins with a '/', the name of the termcap file. 113See 114.Ev TERMPATH 115below, 116.Xr termcap 5 , 117and 118.Xr termcap . 119.It Ev TERMPATH 120A sequence of pathnames of termcap files, separated by colons or spaces, 121which are searched for terminal descriptions in the order listed. Having 122no 123.Ev TERMPATH 124is equivalent to a 125.Ev TERMPATH 126of 127.Dq Pa $HOME/.termcap:/etc/termcap . 128.Ev TERMPATH 129is ignored if 130.Ev TERMCAP 131contains a full pathname. 132.It Ev TMPDIR 133The directory in which to store temporary files. 134Most applications use either 135.Dq /tmp 136or 137.Dq /var/tmp . 138Setting this variable will make them use another directory. 139.It Ev TZ 140The timezone to use when displaying dates. 141The normal format is a pathname relative to 142.Dq /usr/share/zoneinfo . 143For example, the command 144.Dq env TZ=US/Pacific date 145displays the current time in California. 146See 147.Xr tzset 3 148for more information. 149.It Ev USER 150The login name of the user. 151.El 152.Pp 153Further names may be placed in the environment by the 154.Xr export 155command and 156.Ar name=value 157arguments in 158.Xr sh 1 , 159or by the 160.Xr setenv 161command if you use 162.Xr csh 1 . 163It is unwise to change certain 164.Xr sh 1 165variables that are frequently exported by 166.Pa .profile 167files, such as 168.Ev MAIL , 169.Ev PS1 , 170.Ev PS2 , 171and 172.Ev IFS , 173unless you know what you are doing. 174.Sh SEE ALSO 175.Xr csh 1 , 176.Xr ex 1 , 177.Xr login 1 , 178.Xr sh 1 , 179.Xr execve 2 , 180.Xr execle 3 , 181.Xr setlocale 3 , 182.Xr system 3 , 183.Xr termcap 3 , 184.Xr termcap 5 185.Sh HISTORY 186The 187.Nm environ 188manual page appeared in 189.Bx 4.2 . 190