1.\" Copyright (c) 1983, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)environ.7 6.7 (Berkeley) 03/01/92 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 USER 98The login name of the user. 99.El 100.Pp 101Further names may be placed in the environment by the 102.Xr export 103command and 104.Ar name=value 105arguments in 106.Xr sh 1 , 107or by the 108.Xr setenv 109command if you use 110.Xr csh 1 . 111It is unwise to change certain 112.Xr sh 1 113variables that are frequently exported by 114.Pa .profile 115files, such as 116.Ev MAIL , 117.Ev PS1 , 118.Ev PS2 , 119and 120.Ev IFS , 121unless you know what you are doing. 122.Sh SEE ALSO 123.Xr csh 1 , 124.Xr ex 1 , 125.Xr login 1 , 126.Xr sh 1 , 127.Xr execve 2 , 128.Xr execle 3 , 129.Xr system 3 , 130.Xr termcap 3 , 131.Xr termcap 5 132.Sh HISTORY 133The 134.Nm environ 135manual page appeared in 136.Bx 4.2 . 137