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