1.\" Copyright (c) 1983, 1990 The Regents of the University of California. 2.\" 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.\" from: @(#)environ.7 6.6 (Berkeley) 7/19/91 33.\" $Id: environ.7,v 1.2 1993/08/01 07:35:06 mycroft Exp $ 34.\" 35.Dd July 19, 1991 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 Fl 52.It Ev EXINIT 53A startup list of commands read by 54.Xr ex 1 , 55.Xr edit 1 , 56and 57.Xr vi 1 . 58.It Ev HOME 59A user's login directory, set by 60.Xr login 1 61from the password file 62.Xr passwd 5 . 63.It Ev PATH 64The sequence of directories, separated by colons, searched by 65.Xr csh 1 , 66.Xr sh 1 , 67.Xr system 3 , 68.Xr execvp 3 , 69etc, when looking for an executable file. 70PATH is set to ``:/usr/ucb:/bin:/usr/bin'' initially by 71.Xr login 1 . 72.It Ev PRINTER 73The name of the default printer to be used by 74.Xr lpr 1 , 75.Xr lpq 1 , 76and 77.Xr lprm 1 . 78.It Ev SHELL 79The full pathname of the user's login shell. 80.It Ev TERM 81The kind of terminal for which output is to be prepared. 82This information is used by commands, such as 83.Xr nroff 1 84or 85.Xr plot 1 86which may exploit special terminal capabilities. See 87.Pa /usr/share/misc/termcap 88.Pq Xr tmercap 5 89for a list of terminal types. 90.It Ev TERMCAP 91The string describing the terminal in TERM, or, if 92it begins with a '/', the name of the termcap file. 93See 94.Ev TERMPATH 95below, 96.Xr termcap 5 , 97and 98.Xr termcap . 99.It Ev TERMPATH 100A sequence of pathnames of termcap files, separated by colons or spaces, 101which are searched for terminal descriptions in the order listed. Having 102no 103.Ev TERMPATH 104is equivalent to a 105.Ev TERMPATH 106of 107.Dq Pa $HOME/.termcap:/etc/termcap . 108.Ev TERMPATH 109is ignored if 110.Ev TERMCAP 111contains a full pathname. 112.It Ev USER 113The login name of the user. 114.El 115.Pp 116Further names may be placed in the environment by the 117.Xr export 118command and 119.Ar name=value 120arguments in 121.Xr sh 1 , 122or by the 123.Xr setenv 124command if you use 125.Xr csh 1 . 126It is unwise to change certain 127.Xr sh 1 128variables that are frequently exported by 129.Pa .profile 130files, such as 131.Ev MAIL , 132.Ev PS1 , 133.Ev PS2 , 134and 135.Ev IFS , 136unless you know what you are doing. 137.Sh SEE ALSO 138.Xr csh 1 , 139.Xr ex 1 , 140.Xr login 1 , 141.Xr sh 1 , 142.Xr execve 2 , 143.Xr execle 3 , 144.Xr system 3 , 145.Xr termcap 3 , 146.Xr termcap 5 147.Sh HISTORY 148The 149.Nm environ 150manual page appeared in 151.Bx 4.2 . 152