1 | .\" Copyright (c) 1983 Regents of the University of California.
|
---|
2 | .\" All rights reserved. The Berkeley software License Agreement
|
---|
3 | .\" specifies the terms and conditions for redistribution.
|
---|
4 | .\"
|
---|
5 | .\" @(#)environ.7 6.1 (Berkeley) 5/20/85
|
---|
6 | .\"
|
---|
7 | .TH ENVIRON 7 "May 20, 1985"
|
---|
8 | .UC 5
|
---|
9 | .SH NAME
|
---|
10 | environ \- user environment
|
---|
11 | .SH SYNOPSIS
|
---|
12 | .B "extern char *const *environ;"
|
---|
13 | .SH DESCRIPTION
|
---|
14 | An array of strings called the `environment' is made available by
|
---|
15 | .BR execve (2)
|
---|
16 | when a process begins. By convention these strings have the form
|
---|
17 | .RI ` name = value '.
|
---|
18 | The following names are used by various commands:
|
---|
19 | .TP "\w'TERMCAP 'u"
|
---|
20 | .B PATH
|
---|
21 | The sequence of directory prefixes that
|
---|
22 | .BR sh ,
|
---|
23 | .BR time ,
|
---|
24 | .BR nice (1),
|
---|
25 | etc., apply in searching for a file known by an incomplete path name.
|
---|
26 | The prefixes are separated by `:'.
|
---|
27 | Login shells set
|
---|
28 | .BR PATH=:/bin:/usr/bin .
|
---|
29 | Note that the empty space between the `=' and the `:' indicates the current
|
---|
30 | directory. Security aware people move the extra `:' to the end of their
|
---|
31 | path or omit it.
|
---|
32 | .TP
|
---|
33 | .B HOME
|
---|
34 | A user's login directory, set by
|
---|
35 | .BR login (1)
|
---|
36 | from the password file
|
---|
37 | .BR passwd (5).
|
---|
38 | .TP
|
---|
39 | .B TERM
|
---|
40 | The kind of terminal for which output is to be prepared.
|
---|
41 | This information is used by programs that wish to exploit special
|
---|
42 | terminal capabilities, a screen oriented text editor for instance.
|
---|
43 | The terminal type is set by
|
---|
44 | .BR login (1)
|
---|
45 | from the tty database
|
---|
46 | .BR ttytab (5).
|
---|
47 | .TP
|
---|
48 | .B SHELL
|
---|
49 | The file name of the users login shell, set by
|
---|
50 | .BR login (1)
|
---|
51 | from the password file
|
---|
52 | .BR passwd (5).
|
---|
53 | .TP
|
---|
54 | .B TERMCAP
|
---|
55 | The string describing the terminal in TERM, or the name of the termcap file,
|
---|
56 | see
|
---|
57 | .BR termcap (5),
|
---|
58 | .BR termcap (3).
|
---|
59 | .TP
|
---|
60 | .B EXINIT
|
---|
61 | A startup list of commands read by
|
---|
62 | .BR elvis (1).
|
---|
63 | .TP
|
---|
64 | .B USER
|
---|
65 | The login name of the user, set by
|
---|
66 | .BR login (1)
|
---|
67 | from the password file
|
---|
68 | .BR passwd (5).
|
---|
69 | .TP
|
---|
70 | .B LOGNAME
|
---|
71 | Set to the same value as
|
---|
72 | .BR USER .
|
---|
73 | BSD derived systems have
|
---|
74 | .BR USER ,
|
---|
75 | System V has
|
---|
76 | .BR LOGNAME ,
|
---|
77 | so modern systems have both to avoid problems.
|
---|
78 | .TP
|
---|
79 | .PP
|
---|
80 | Further names may be placed in the environment by the
|
---|
81 | .B export
|
---|
82 | command and
|
---|
83 | .RI ` name = value '
|
---|
84 | arguments in
|
---|
85 | .BR sh (1).
|
---|
86 | Arguments may also be placed in their environment by
|
---|
87 | programs if they use
|
---|
88 | .BR putenv (3).
|
---|
89 | Or in the environment of another program by building a new environment
|
---|
90 | for one of the exec functions that accepts an environment list, like
|
---|
91 | .BR execle (2)
|
---|
92 | or
|
---|
93 | .BR execve (2).
|
---|
94 | It is unwise to conflict with certain
|
---|
95 | .BR sh (1)
|
---|
96 | variables that are frequently set and/or exported by `.profile' files:
|
---|
97 | .BR MAIL ,
|
---|
98 | .BR PS1 ,
|
---|
99 | .BR PS2 ,
|
---|
100 | .BR IFS .
|
---|
101 | .SH SEE ALSO
|
---|
102 | .BR elvis (1),
|
---|
103 | .BR login (1),
|
---|
104 | .BR sh (1),
|
---|
105 | .BR execl (3),
|
---|
106 | .BR execve (2),
|
---|
107 | .BR system (3),
|
---|
108 | .BR termcap (3),
|
---|
109 | .BR termcap (5),
|
---|
110 | .BR passwd (5),
|
---|
111 | .BR ttytab (5).
|
---|