xref: /csrg-svn/share/man/man7/environ.7 (revision 56676)
143687Scael.\" Copyright (c) 1983, 1990 The Regents of the University of California.
243687Scael.\" All rights reserved.
320969Smckusick.\"
450441Scael.\" %sccs.include.redist.roff%
520969Smckusick.\"
6*56676Sbostic.\"	@(#)environ.7	6.8 (Berkeley) 11/04/92
743687Scael.\"
843687Scael.Dd
943687Scael.Dt ENVIRON 7
1043687Scael.Os BSD 4.2
1143687Scael.Sh NAME
1243687Scael.Nm environ
1343687Scael.Nd user environment
1443687Scael.Sh SYNOPSIS
1543687Scael.Ar extern char **environ ;
1643687Scael.Sh DESCRIPTION
1732394SjakAn array of strings called the
1843687Scael.Ar environment
1932394Sjakis made available by
2043687Scael.Xr execve  2
2120969Smckusickwhen a process begins.  By convention these strings have the form
2243687Scael.Dq Ar name=value .
2343687ScaelThe following names are used by various commands:
2452777Sbostic.Bl -tag -width BLOCKSIZE
2552777Sbostic.It Ev BLOCKSIZE
2652777SbosticThe size of the block units used by several commands, most notably
2752777Sbostic.Xr df 1 ,
2852777Sbostic.Xr du 1
2952777Sbosticand
3052777Sbostic.Xr ls 1 .
3152777SbosticBLOCKSIZE may be specified in units of a byte by specifying a number,
3252777Sbosticin units of a kilobyte by specifying a number followed by ``K'' or
3352777Sbostic``k'', in units of a megabyte by specifying a number followed by ``M''
3452777Sbosticor ``m'' and in units of a gigabyte by specifying a number followed
3552777Sbosticby ``G'' or ``g''.
3652777SbosticSizes less than 512 bytes or greater than a gigabyte are ignored.
3750441Scael.It Ev EXINIT
3832394SjakA startup list of commands read by
3943687Scael.Xr ex  1  ,
4043687Scael.Xr edit  1 ,
4132394Sjakand
4243687Scael.Xr vi  1  .
4350441Scael.It Ev HOME
4420969SmckusickA user's login directory, set by
4543687Scael.Xr login  1
4620969Smckusickfrom the password file
4743687Scael.Xr passwd  5  .
4850441Scael.It Ev PATH
4932394SjakThe sequence of directories, separated by colons, searched by
5043687Scael.Xr csh  1  ,
5143687Scael.Xr sh  1 ,
5243687Scael.Xr system  3  ,
5343687Scael.Xr execvp  3 ,
5432395Sbosticetc, when looking for an executable file.
5532395SbosticPATH is set to ``:/usr/ucb:/bin:/usr/bin'' initially by
5643687Scael.Xr login  1  .
5750441Scael.It Ev PRINTER
5832394SjakThe name of the default printer to be used by
5943687Scael.Xr lpr  1  ,
6043687Scael.Xr lpq  1 ,
6132394Sjakand
6243687Scael.Xr lprm  1  .
6350441Scael.It Ev SHELL
6432394SjakThe full pathname of the user's login shell.
6550441Scael.It Ev TERM
6620969SmckusickThe kind of terminal for which output is to be prepared.
6720969SmckusickThis information is used by commands, such as
6843687Scael.Xr nroff  1
6920969Smckusickor
7043687Scael.Xr plot 1
7120969Smckusickwhich may exploit special terminal capabilities.  See
7243687Scael.Pa /usr/share/misc/termcap
7343687Scael.Pq Xr tmercap 5
7420969Smckusickfor a list of terminal types.
7550441Scael.It Ev TERMCAP
7632394SjakThe string describing the terminal in TERM, or, if
7732394Sjakit begins with a '/', the name of the termcap file.
7843687ScaelSee
7943687Scael.Ev TERMPATH
8043687Scaelbelow,
8143687Scael.Xr termcap  5  ,
8220969Smckusickand
8343687Scael.Xr termcap  .
8450441Scael.It Ev TERMPATH
8532394SjakA sequence of pathnames of termcap files, separated by colons or spaces,
8632395Sbosticwhich are searched for terminal descriptions in the order listed.  Having
8743687Scaelno
8843687Scael.Ev TERMPATH
8943687Scaelis equivalent to a
9043687Scael.Ev TERMPATH
9143687Scaelof
9243687Scael.Dq Pa $HOME/.termcap:/etc/termcap .
9343687Scael.Ev TERMPATH
9443687Scaelis ignored if
9543687Scael.Ev TERMCAP
9643687Scaelcontains a full pathname.
97*56676Sbostic.It Ev TMPDIR
98*56676SbosticThe directory in which to store temporary files.
99*56676SbosticMost applications use either
100*56676Sbostic.Dq /tmp
101*56676Sbosticor
102*56676Sbostic.Dq /var/tmp .
103*56676SbosticSetting this variable will make them use another directory.
10450441Scael.It Ev USER
10520969SmckusickThe login name of the user.
10650441Scael.El
10743687Scael.Pp
10820969SmckusickFurther names may be placed in the environment by the
10943687Scael.Xr export
11032394Sjakcommand and
11143687Scael.Ar name=value
11232394Sjakarguments in
11343687Scael.Xr sh  1  ,
11420969Smckusickor by the
11543687Scael.Xr setenv
11620969Smckusickcommand if you use
11743687Scael.Xr csh  1  .
11843687ScaelIt is unwise to change certain
11943687Scael.Xr sh  1
12032394Sjakvariables that are frequently exported by
12143687Scael.Pa .profile
12243687Scaelfiles, such as
12343687Scael.Ev MAIL ,
12443687Scael.Ev PS1 ,
12543687Scael.Ev PS2 ,
12643687Scaeland
12743687Scael.Ev IFS ,
12832394Sjakunless you know what you are doing.
12943687Scael.Sh SEE ALSO
13043687Scael.Xr csh 1 ,
13143687Scael.Xr ex 1 ,
13243687Scael.Xr login 1 ,
13343687Scael.Xr sh 1 ,
13443687Scael.Xr execve 2 ,
13543687Scael.Xr execle 3 ,
13643687Scael.Xr system 3 ,
13743687Scael.Xr termcap 3 ,
13843687Scael.Xr termcap 5
13943687Scael.Sh HISTORY
14050441ScaelThe
14150441Scael.Nm environ
14250441Scaelmanual page appeared in
14350441Scael.Bx 4.2 .
144