]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - share/man/man7/environ.7
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / share / man / man7 / environ.7
1 .\" Copyright (c) 1983, 1990, 1993
2 .\"     The Regents of the University of California.  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 .\"     @(#)environ.7   8.3 (Berkeley) 4/19/94
33 .\" $FreeBSD$
34 .\"
35 .Dd April 12, 2003
36 .Dt ENVIRON 7
37 .Os
38 .Sh NAME
39 .Nm environ
40 .Nd user environment
41 .Sh SYNOPSIS
42 .Ar extern char **environ ;
43 .Sh DESCRIPTION
44 An array of strings called the
45 .Ar environment
46 is made available by
47 .Xr execve 2
48 when a process begins.
49 By convention these strings have the form
50 .Dq Ar name=value .
51 The following names are used by various commands:
52 .Bl -tag -width LC_MONETARY
53 .It Ev BLOCKSIZE
54 The size of the block units used by several commands, most notably
55 .Xr df 1 ,
56 .Xr du 1
57 and
58 .Xr ls 1 .
59 This variable is processed by the
60 .Xr getbsize 3
61 function.
62 .It Ev COLUMNS
63 The user's preferred width in column positions for the terminal.
64 Utilities such as
65 .Xr ls 1
66 and
67 .Xr who 1
68 use this to format output into columns.
69 If unset or empty, utilities will use an
70 .Xr ioctl 2
71 call to ask the terminal driver for the width.
72 .It Ev EDITOR
73 Default editor name.
74 .It Ev EXINIT
75 A startup list of commands read by
76 .Xr ex 1
77 and
78 .Xr vi 1 .
79 .It Ev HOME
80 A user's login directory, set by
81 .Xr login 1
82 from the password file
83 .Xr passwd 5 .
84 .It Ev LANG
85 This variable configures all programs which use
86 .Xr setlocale 3
87 to use the specified locale unless the
88 .Ev LC_*
89 variables are set.
90 .It Ev LC_ALL
91 Overrides the values of
92 .Ev LC_COLLATE ,
93 .Ev LC_CTYPE ,
94 .Ev LC_MESSAGES ,
95 .Ev LC_MONETARY ,
96 .Ev LC_NUMERIC ,
97 .Ev LC_TIME
98 and
99 .Ev LANG .
100 .It Ev LC_COLLATE
101 Locale to be used for ordering of strings.
102 .It Ev LC_CTYPE
103 Locale to be used for character classification
104 (letter, space, digit, etc.) and for interpreting byte sequences as
105 multibyte characters.
106 .It Ev LC_MESSAGES
107 Locale to be used for diagnostic messages.
108 .It Ev LC_MONETARY
109 Locale to be used for interpreting monetary input
110 and formatting output.
111 .It Ev LC_NUMERIC
112 Locale to be used for interpreting numeric input and
113 formatting output.
114 .It Ev LC_TIME
115 Locale to be used for interpreting dates input and
116 for formatting output.
117 .It Ev MAIL
118 The location of the user's
119 mailbox instead of the default in /var/mail,
120 used by
121 .Xr mail 1 ,
122 .Xr sh 1 ,
123 and many other mail clients.
124 .It Ev NLSPATH
125 List of directories to be searched for the message catalog referred to by
126 .Ev LC_MESSAGES .
127 See
128 .Xr catopen 3 .
129 .It Ev PAGER
130 Default paginator program.
131 The program specified by this variable is used by
132 .Xr mail 1 ,
133 .Xr man 1 ,
134 .Xr ftp 1 ,
135 etc, to display information which is longer than the current display.
136 .It Ev PATH
137 The sequence of directories, separated by colons, searched by
138 .Xr csh 1 ,
139 .Xr sh 1 ,
140 .Xr system 3 ,
141 .Xr execvp 3 ,
142 etc, when looking for an executable file.
143 .Ev PATH
144 is set to ``/usr/bin:/bin'' initially by
145 .Xr login 1 .
146 .It Ev PRINTER
147 The name of the default printer to be used by
148 .Xr lpr 1 ,
149 .Xr lpq 1 ,
150 and
151 .Xr lprm 1 .
152 .It Ev PWD
153 The current directory pathname.
154 .It Ev SHELL
155 The full pathname of the user's login shell.
156 .It Ev TERM
157 The kind of terminal for which output is to be prepared.
158 This information is used by commands, such as
159 .Xr nroff 1
160 or
161 .Xr plot 1
162 which may exploit special terminal capabilities.
163 See
164 .Pa /usr/share/misc/termcap
165 .Pq Xr termcap 5
166 for a list of terminal types.
167 .It Ev TERMCAP
168 The string describing the terminal in
169 .Ev TERM ,
170 or, if
171 it begins with a '/', the name of the termcap file.
172 See
173 .Ev TERMPATH
174 below, and
175 .Xr termcap 5 .
176 .It Ev TERMPATH
177 A sequence of pathnames of termcap files, separated by colons or spaces,
178 which are searched for terminal descriptions in the order listed.
179 Having
180 no
181 .Ev TERMPATH
182 is equivalent to a
183 .Ev TERMPATH
184 of
185 .Dq Pa $HOME/.termcap:/etc/termcap .
186 .Ev TERMPATH
187 is ignored if
188 .Ev TERMCAP
189 contains a full pathname.
190 .It Ev TMPDIR
191 The directory in which to store temporary files.
192 Most applications use either
193 .Dq /tmp
194 or
195 .Dq /var/tmp .
196 Setting this variable will make them use another directory.
197 .It Ev TZ
198 The timezone to use when displaying dates.
199 The normal format is a pathname relative to
200 .Dq Pa /usr/share/zoneinfo .
201 For example, the command
202 .Dq env TZ=America/Los_Angeles date
203 displays the current time in California.
204 See
205 .Xr tzset 3
206 for more information.
207 .It Ev USER
208 The login name of the user.
209 .El
210 .Pp
211 Further names may be placed in the environment by the
212 .Ic export
213 command and
214 .Ar name=value
215 arguments in
216 .Xr sh 1 ,
217 or by the
218 .Ic setenv
219 command if you use
220 .Xr csh 1 .
221 It is unwise to change certain
222 .Xr sh 1
223 variables that are frequently exported by
224 .Pa .profile
225 files, such as
226 .Ev MAIL ,
227 .Ev PS1 ,
228 .Ev PS2 ,
229 and
230 .Ev IFS ,
231 unless you know what you are doing.
232 .Pp
233 The current environment variables can be printed with
234 .Xr env 1 ,
235 .Xr set 1
236 or
237 .Xr printenv 1
238 in
239 .Xr sh 1
240 and
241 .Xr env 1 ,
242 .Xr printenv 1
243 or the
244 .Cm printenv
245 built-in command in
246 .Xr csh 1 .
247 .Sh SEE ALSO
248 .Xr cd 1 ,
249 .Xr csh 1 ,
250 .Xr env 1 ,
251 .Xr ex 1 ,
252 .Xr login 1 ,
253 .Xr printenv 1 ,
254 .Xr sh 1 ,
255 .Xr execve 2 ,
256 .Xr execle 3 ,
257 .Xr getenv 3 ,
258 .Xr getbsize 3 ,
259 .Xr setenv 3 ,
260 .Xr setlocale 3 ,
261 .Xr system 3 ,
262 .Xr termcap 3 ,
263 .Xr termcap 5
264 .Sh HISTORY
265 The
266 .Nm
267 manual page appeared in
268 .Bx 4.2 .