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.\" $Id: environ.7,v 1.9 1997/03/07 03:28:14 jmg Exp $ 34.\" 35.Dd April 19, 1994 36.Dt ENVIRON 7 37.Os BSD 4.2 38.Sh NAME 39.Nm environ 40.Nd user environment 41.Sh SYNOPSIS 42.Ar extern char **environ ; 43.Sh DESCRIPTION 44An array of strings called the 45.Ar environment 46is made available by 47.Xr execve 2 48when a process begins. By convention these strings have the form 49.Dq Ar name=value . 50The following names are used by various commands: 51.Bl -tag -width BLOCKSIZE 52.It Ev BLOCKSIZE 53The size of the block units used by several commands, most notably 54.Xr df 1 , 55.Xr du 1 56and 57.Xr ls 1 . 58.Ev BLOCKSIZE 59may be specified in units of a byte by specifying a number, 60in units of a kilobyte by specifying a number followed by ``K'' or 61``k'', in units of a megabyte by specifying a number followed by ``M'' 62or ``m'' and in units of a gigabyte by specifying a number followed 63by ``G'' or ``g''. 64Sizes less than 512 bytes or greater than a gigabyte are ignored. 65.It Ev EXINIT 66A startup list of commands read by 67.Xr ex 1 , 68.Xr edit 1 , 69and 70.Xr vi 1 . 71.It Ev HOME 72A user's login directory, set by 73.Xr login 1 74from the password file 75.Xr passwd 5 . 76.It Ev LANG 77This variable configures all programs which use 78.Xr setlocale 3 79to use the specified locale. 80.It Ev MAIL 81The location of the user's 82mailbox instead of the default in /var/mail, 83used by 84.Xr mail 1 , 85.Xr sh 1 , 86and many other mailclients. 87.It Ev PATH 88The sequence of directories, separated by colons, searched by 89.Xr csh 1 , 90.Xr sh 1 , 91.Xr system 3 , 92.Xr execvp 3 , 93etc, when looking for an executable file. 94.Ev PATH 95is set to ``/usr/bin:/bin'' initially by 96.Xr login 1 . 97.It Ev PRINTER 98The name of the default printer to be used by 99.Xr lpr 1 , 100.Xr lpq 1 , 101and 102.Xr lprm 1 . 103.It Ev SHELL 104The full pathname of the user's login shell. 105.It Ev TERM 106The kind of terminal for which output is to be prepared. 107This information is used by commands, such as 108.Xr nroff 1 109or 110.Xr plot 1 111which may exploit special terminal capabilities. See 112.Pa /usr/share/misc/termcap 113.Pq Xr termcap 5 114for a list of terminal types. 115.It Ev TERMCAP 116The string describing the terminal in 117.Ev TERM , 118or, if 119it begins with a '/', the name of the termcap file. 120See 121.Ev TERMPATH 122below, 123.Xr termcap 5 , 124and 125.Xr termcap . 126.It Ev TERMPATH 127A sequence of pathnames of termcap files, separated by colons or spaces, 128which are searched for terminal descriptions in the order listed. Having 129no 130.Ev TERMPATH 131is equivalent to a 132.Ev TERMPATH 133of 134.Dq Pa $HOME/.termcap:/etc/termcap . 135.Ev TERMPATH 136is ignored if 137.Ev TERMCAP 138contains a full pathname. 139.It Ev TMPDIR 140The directory in which to store temporary files. 141Most applications use either 142.Dq /tmp 143or 144.Dq /var/tmp . 145Setting this variable will make them use another directory. 146.It Ev TZ 147The timezone to use when displaying dates. 148The normal format is a pathname relative to 149.Dq Pa /usr/share/zoneinfo . 150For example, the command 151.Dq env TZ=America/Los_Angeles date 152displays the current time in California. 153See 154.Xr tzset 3 155for more information. 156.It Ev USER 157The login name of the user. 158.El 159.Pp 160Further names may be placed in the environment by the 161.Xr export 162command and 163.Ar name=value 164arguments in 165.Xr sh 1 , 166or by the 167.Xr setenv 168command if you use 169.Xr csh 1 . 170It is unwise to change certain 171.Xr sh 1 172variables that are frequently exported by 173.Pa .profile 174files, such as 175.Ev MAIL , 176.Ev PS1 , 177.Ev PS2 , 178and 179.Ev IFS , 180unless you know what you are doing. 181.Sh SEE ALSO 182.Xr cd 1 , 183.Xr csh 1 , 184.Xr ex 1 , 185.Xr login 1 , 186.Xr sh 1 , 187.Xr execve 2 , 188.Xr execle 3 , 189.Xr setlocale 3 , 190.Xr system 3 , 191.Xr termcap 3 , 192.Xr termcap 5 193.Sh HISTORY 194The 195.Nm environ 196manual page appeared in 197.Bx 4.2 . 198