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.3 (Berkeley) 04/19/94 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 termcap 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 TZ 105The timezone to use when displaying dates. 106The normal format is a pathname relative to 107.Dq /usr/share/zoneinfo . 108For example, the command 109.Dq env TZ=US/Pacific date 110displays the current time in California. 111See 112.Xr tzset 3 113for more information. 114.It Ev USER 115The login name of the user. 116.El 117.Pp 118Further names may be placed in the environment by the 119.Xr export 120command and 121.Ar name=value 122arguments in 123.Xr sh 1 , 124or by the 125.Xr setenv 126command if you use 127.Xr csh 1 . 128It is unwise to change certain 129.Xr sh 1 130variables that are frequently exported by 131.Pa .profile 132files, such as 133.Ev MAIL , 134.Ev PS1 , 135.Ev PS2 , 136and 137.Ev IFS , 138unless you know what you are doing. 139.Sh SEE ALSO 140.Xr csh 1 , 141.Xr ex 1 , 142.Xr login 1 , 143.Xr sh 1 , 144.Xr execve 2 , 145.Xr execle 3 , 146.Xr system 3 , 147.Xr termcap 3 , 148.Xr termcap 5 149.Sh HISTORY 150The 151.Nm environ 152manual page appeared in 153.Bx 4.2 . 154