xref: /csrg-svn/share/man/man7/environ.7 (revision 52777)
143687Scael.\" Copyright (c) 1983, 1990 The Regents of the University of California.
243687Scael.\" All rights reserved.
320969Smckusick.\"
450441Scael.\" %sccs.include.redist.roff%
520969Smckusick.\"
6*52777Sbostic.\"	@(#)environ.7	6.7 (Berkeley) 03/01/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:
24*52777Sbostic.Bl -tag -width BLOCKSIZE
25*52777Sbostic.It Ev BLOCKSIZE
26*52777SbosticThe size of the block units used by several commands, most notably
27*52777Sbostic.Xr df 1 ,
28*52777Sbostic.Xr du 1
29*52777Sbosticand
30*52777Sbostic.Xr ls 1 .
31*52777SbosticBLOCKSIZE may be specified in units of a byte by specifying a number,
32*52777Sbosticin units of a kilobyte by specifying a number followed by ``K'' or
33*52777Sbostic``k'', in units of a megabyte by specifying a number followed by ``M''
34*52777Sbosticor ``m'' and in units of a gigabyte by specifying a number followed
35*52777Sbosticby ``G'' or ``g''.
36*52777SbosticSizes 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.
9750441Scael.It Ev USER
9820969SmckusickThe login name of the user.
9950441Scael.El
10043687Scael.Pp
10120969SmckusickFurther names may be placed in the environment by the
10243687Scael.Xr export
10332394Sjakcommand and
10443687Scael.Ar name=value
10532394Sjakarguments in
10643687Scael.Xr sh  1  ,
10720969Smckusickor by the
10843687Scael.Xr setenv
10920969Smckusickcommand if you use
11043687Scael.Xr csh  1  .
11143687ScaelIt is unwise to change certain
11243687Scael.Xr sh  1
11332394Sjakvariables that are frequently exported by
11443687Scael.Pa .profile
11543687Scaelfiles, such as
11643687Scael.Ev MAIL ,
11743687Scael.Ev PS1 ,
11843687Scael.Ev PS2 ,
11943687Scaeland
12043687Scael.Ev IFS ,
12132394Sjakunless you know what you are doing.
12243687Scael.Sh SEE ALSO
12343687Scael.Xr csh 1 ,
12443687Scael.Xr ex 1 ,
12543687Scael.Xr login 1 ,
12643687Scael.Xr sh 1 ,
12743687Scael.Xr execve 2 ,
12843687Scael.Xr execle 3 ,
12943687Scael.Xr system 3 ,
13043687Scael.Xr termcap 3 ,
13143687Scael.Xr termcap 5
13243687Scael.Sh HISTORY
13350441ScaelThe
13450441Scael.Nm environ
13550441Scaelmanual page appeared in
13650441Scael.Bx 4.2 .
137