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