1.\" Copyright (c) 1983, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)environ.7 8.1 (Berkeley) 06/05/93 7.\" 8.Dd 9.Dt ENVIRON 7 10.Os BSD 4.2 11.Sh NAME 12.Nm environ 13.Nd user environment 14.Sh SYNOPSIS 15.Ar extern char **environ ; 16.Sh DESCRIPTION 17An array of strings called the 18.Ar environment 19is made available by 20.Xr execve 2 21when a process begins. By convention these strings have the form 22.Dq Ar name=value . 23The following names are used by various commands: 24.Bl -tag -width BLOCKSIZE 25.It Ev BLOCKSIZE 26The size of the block units used by several commands, most notably 27.Xr df 1 , 28.Xr du 1 29and 30.Xr ls 1 . 31BLOCKSIZE may be specified in units of a byte by specifying a number, 32in units of a kilobyte by specifying a number followed by ``K'' or 33``k'', in units of a megabyte by specifying a number followed by ``M'' 34or ``m'' and in units of a gigabyte by specifying a number followed 35by ``G'' or ``g''. 36Sizes less than 512 bytes or greater than a gigabyte are ignored. 37.It Ev EXINIT 38A startup list of commands read by 39.Xr ex 1 , 40.Xr edit 1 , 41and 42.Xr vi 1 . 43.It Ev HOME 44A user's login directory, set by 45.Xr login 1 46from the password file 47.Xr passwd 5 . 48.It Ev PATH 49The sequence of directories, separated by colons, searched by 50.Xr csh 1 , 51.Xr sh 1 , 52.Xr system 3 , 53.Xr execvp 3 , 54etc, when looking for an executable file. 55PATH is set to ``:/usr/ucb:/bin:/usr/bin'' initially by 56.Xr login 1 . 57.It Ev PRINTER 58The name of the default printer to be used by 59.Xr lpr 1 , 60.Xr lpq 1 , 61and 62.Xr lprm 1 . 63.It Ev SHELL 64The full pathname of the user's login shell. 65.It Ev TERM 66The kind of terminal for which output is to be prepared. 67This information is used by commands, such as 68.Xr nroff 1 69or 70.Xr plot 1 71which may exploit special terminal capabilities. See 72.Pa /usr/share/misc/termcap 73.Pq Xr tmercap 5 74for a list of terminal types. 75.It Ev TERMCAP 76The string describing the terminal in TERM, or, if 77it begins with a '/', the name of the termcap file. 78See 79.Ev TERMPATH 80below, 81.Xr termcap 5 , 82and 83.Xr termcap . 84.It Ev TERMPATH 85A sequence of pathnames of termcap files, separated by colons or spaces, 86which are searched for terminal descriptions in the order listed. Having 87no 88.Ev TERMPATH 89is equivalent to a 90.Ev TERMPATH 91of 92.Dq Pa $HOME/.termcap:/etc/termcap . 93.Ev TERMPATH 94is ignored if 95.Ev TERMCAP 96contains a full pathname. 97.It Ev TMPDIR 98The directory in which to store temporary files. 99Most applications use either 100.Dq /tmp 101or 102.Dq /var/tmp . 103Setting this variable will make them use another directory. 104.It Ev USER 105The login name of the user. 106.El 107.Pp 108Further names may be placed in the environment by the 109.Xr export 110command and 111.Ar name=value 112arguments in 113.Xr sh 1 , 114or by the 115.Xr setenv 116command if you use 117.Xr csh 1 . 118It is unwise to change certain 119.Xr sh 1 120variables that are frequently exported by 121.Pa .profile 122files, such as 123.Ev MAIL , 124.Ev PS1 , 125.Ev PS2 , 126and 127.Ev IFS , 128unless you know what you are doing. 129.Sh SEE ALSO 130.Xr csh 1 , 131.Xr ex 1 , 132.Xr login 1 , 133.Xr sh 1 , 134.Xr execve 2 , 135.Xr execle 3 , 136.Xr system 3 , 137.Xr termcap 3 , 138.Xr termcap 5 139.Sh HISTORY 140The 141.Nm environ 142manual page appeared in 143.Bx 4.2 . 144