xref: /freebsd/share/man/man7/environ.7 (revision 8209febbb3d07809890550a0048b2d76363239f9)
1afe61c15SRodney W. Grimes.\" Copyright (c) 1983, 1990, 1993
2afe61c15SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3afe61c15SRodney W. Grimes.\"
4afe61c15SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5afe61c15SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6afe61c15SRodney W. Grimes.\" are met:
7afe61c15SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9afe61c15SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11afe61c15SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors
13afe61c15SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
14afe61c15SRodney W. Grimes.\"    without specific prior written permission.
15afe61c15SRodney W. Grimes.\"
16afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19afe61c15SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26afe61c15SRodney W. Grimes.\" SUCH DAMAGE.
27afe61c15SRodney W. Grimes.\"
28afe61c15SRodney W. Grimes.\"	@(#)environ.7	8.3 (Berkeley) 4/19/94
297f3dea24SPeter Wemm.\" $FreeBSD$
30afe61c15SRodney W. Grimes.\"
31*8209febbSSergio Carlavilla Delgado.Dd February 14, 2020
32afe61c15SRodney W. Grimes.Dt ENVIRON 7
333d45e180SRuslan Ermilov.Os
34afe61c15SRodney W. Grimes.Sh NAME
35afe61c15SRodney W. Grimes.Nm environ
36afe61c15SRodney W. Grimes.Nd user environment
37afe61c15SRodney W. Grimes.Sh SYNOPSIS
38afe61c15SRodney W. Grimes.Ar extern char **environ ;
39afe61c15SRodney W. Grimes.Sh DESCRIPTION
40afe61c15SRodney W. GrimesAn array of strings called the
41afe61c15SRodney W. Grimes.Ar environment
42afe61c15SRodney W. Grimesis made available by
43afe61c15SRodney W. Grimes.Xr execve 2
445203edcdSRuslan Ermilovwhen a process begins.
455203edcdSRuslan ErmilovBy convention these strings have the form
46afe61c15SRodney W. Grimes.Dq Ar name=value .
47afe61c15SRodney W. GrimesThe following names are used by various commands:
4866d62591STim J. Robbins.Bl -tag -width LC_MONETARY
49afe61c15SRodney W. Grimes.It Ev BLOCKSIZE
50afe61c15SRodney W. GrimesThe size of the block units used by several commands, most notably
51afe61c15SRodney W. Grimes.Xr df 1 ,
52afe61c15SRodney W. Grimes.Xr du 1
53afe61c15SRodney W. Grimesand
54afe61c15SRodney W. Grimes.Xr ls 1 .
55370cbbf2SGreg LeheyThis variable is processed by the
56370cbbf2SGreg Lehey.Xr getbsize 3
57370cbbf2SGreg Leheyfunction.
58c309b053STim J. Robbins.It Ev COLUMNS
59c309b053STim J. RobbinsThe user's preferred width in column positions for the terminal.
60c309b053STim J. RobbinsUtilities such as
61c309b053STim J. Robbins.Xr ls 1
62c309b053STim J. Robbinsand
63c309b053STim J. Robbins.Xr who 1
64c309b053STim J. Robbinsuse this to format output into columns.
65c309b053STim J. RobbinsIf unset or empty, utilities will use an
66c309b053STim J. Robbins.Xr ioctl 2
67c309b053STim J. Robbinscall to ask the terminal driver for the width.
6806651299SMike Pritchard.It Ev EDITOR
6906651299SMike PritchardDefault editor name.
70afe61c15SRodney W. Grimes.It Ev EXINIT
71afe61c15SRodney W. GrimesA startup list of commands read by
724571317aSJoseph Koshy.Xr ex 1
73afe61c15SRodney W. Grimesand
74afe61c15SRodney W. Grimes.Xr vi 1 .
75afe61c15SRodney W. Grimes.It Ev HOME
76afe61c15SRodney W. GrimesA user's login directory, set by
77afe61c15SRodney W. Grimes.Xr login 1
78afe61c15SRodney W. Grimesfrom the password file
79afe61c15SRodney W. Grimes.Xr passwd 5 .
8001eddd58SAndrey A. Chernov.It Ev LANG
81edf0e5b3SMike PritchardThis variable configures all programs which use
82906c1e27SMike Pritchard.Xr setlocale 3
83a5c2a55dSAndrey A. Chernovto use the specified locale unless the
84a5c2a55dSAndrey A. Chernov.Ev LC_*
85a5c2a55dSAndrey A. Chernovvariables are set.
8666d62591STim J. Robbins.It Ev LC_ALL
8766d62591STim J. RobbinsOverrides the values of
8866d62591STim J. Robbins.Ev LC_COLLATE ,
8966d62591STim J. Robbins.Ev LC_CTYPE ,
9066d62591STim J. Robbins.Ev LC_MESSAGES ,
9166d62591STim J. Robbins.Ev LC_MONETARY ,
92a5c2a55dSAndrey A. Chernov.Ev LC_NUMERIC ,
93a5c2a55dSAndrey A. Chernov.Ev LC_TIME
9466d62591STim J. Robbinsand
95a5c2a55dSAndrey A. Chernov.Ev LANG .
9666d62591STim J. Robbins.It Ev LC_COLLATE
9766d62591STim J. RobbinsLocale to be used for ordering of strings.
9866d62591STim J. Robbins.It Ev LC_CTYPE
9966d62591STim J. RobbinsLocale to be used for character classification
10066d62591STim J. Robbins(letter, space, digit, etc.) and for interpreting byte sequences as
10166d62591STim J. Robbinsmultibyte characters.
10266d62591STim J. Robbins.It Ev LC_MESSAGES
10366d62591STim J. RobbinsLocale to be used for diagnostic messages.
10466d62591STim J. Robbins.It Ev LC_MONETARY
10566d62591STim J. RobbinsLocale to be used for interpreting monetary input
10666d62591STim J. Robbinsand formatting output.
10766d62591STim J. Robbins.It Ev LC_NUMERIC
10866d62591STim J. RobbinsLocale to be used for interpreting numeric input and
10966d62591STim J. Robbinsformatting output.
11066d62591STim J. Robbins.It Ev LC_TIME
11166d62591STim J. RobbinsLocale to be used for interpreting dates input and
11266d62591STim J. Robbinsfor formatting output.
113c7fa2a65SWolfram Schneider.It Ev MAIL
114c7fa2a65SWolfram SchneiderThe location of the user's
115c7fa2a65SWolfram Schneidermailbox instead of the default in /var/mail,
116c7fa2a65SWolfram Schneiderused by
117c7fa2a65SWolfram Schneider.Xr mail 1 ,
118c7fa2a65SWolfram Schneider.Xr sh 1 ,
119c7fa2a65SWolfram Schneiderand many other mail clients.
12066d62591STim J. Robbins.It Ev NLSPATH
12166d62591STim J. RobbinsList of directories to be searched for the message catalog referred to by
12266d62591STim J. Robbins.Ev LC_MESSAGES .
12366d62591STim J. RobbinsSee
12466d62591STim J. Robbins.Xr catopen 3 .
12506651299SMike Pritchard.It Ev PAGER
1265203edcdSRuslan ErmilovDefault paginator program.
1275203edcdSRuslan ErmilovThe program specified by this variable is used by
12806651299SMike Pritchard.Xr mail 1 ,
12906651299SMike Pritchard.Xr man 1 ,
13006651299SMike Pritchard.Xr ftp 1 ,
13106651299SMike Pritchardetc, to display information which is longer than the current display.
132afe61c15SRodney W. Grimes.It Ev PATH
133afe61c15SRodney W. GrimesThe sequence of directories, separated by colons, searched by
134afe61c15SRodney W. Grimes.Xr csh 1 ,
135afe61c15SRodney W. Grimes.Xr sh 1 ,
136afe61c15SRodney W. Grimes.Xr system 3 ,
137afe61c15SRodney W. Grimes.Xr execvp 3 ,
138afe61c15SRodney W. Grimesetc, when looking for an executable file.
139edf0e5b3SMike Pritchard.Ev PATH
140edf0e5b3SMike Pritchardis set to ``/usr/bin:/bin'' initially by
141afe61c15SRodney W. Grimes.Xr login 1 .
142afe61c15SRodney W. Grimes.It Ev PRINTER
143afe61c15SRodney W. GrimesThe name of the default printer to be used by
144afe61c15SRodney W. Grimes.Xr lpr 1 ,
145afe61c15SRodney W. Grimes.Xr lpq 1 ,
146afe61c15SRodney W. Grimesand
147afe61c15SRodney W. Grimes.Xr lprm 1 .
14806651299SMike Pritchard.It Ev PWD
14906651299SMike PritchardThe current directory pathname.
150afe61c15SRodney W. Grimes.It Ev SHELL
151afe61c15SRodney W. GrimesThe full pathname of the user's login shell.
152afe61c15SRodney W. Grimes.It Ev TERM
153afe61c15SRodney W. GrimesThe kind of terminal for which output is to be prepared.
154afe61c15SRodney W. GrimesThis information is used by commands, such as
155afe61c15SRodney W. Grimes.Xr nroff 1
156afe61c15SRodney W. Grimesor
157afe61c15SRodney W. Grimes.Xr plot 1
1585203edcdSRuslan Ermilovwhich may exploit special terminal capabilities.
1595203edcdSRuslan ErmilovSee
160afe61c15SRodney W. Grimes.Pa /usr/share/misc/termcap
161afe61c15SRodney W. Grimes.Pq Xr termcap 5
162afe61c15SRodney W. Grimesfor a list of terminal types.
163afe61c15SRodney W. Grimes.It Ev TERMCAP
164edf0e5b3SMike PritchardThe string describing the terminal in
165edf0e5b3SMike Pritchard.Ev TERM ,
166edf0e5b3SMike Pritchardor, if
167afe61c15SRodney W. Grimesit begins with a '/', the name of the termcap file.
168afe61c15SRodney W. GrimesSee
169afe61c15SRodney W. Grimes.Ev TERMPATH
1704571317aSJoseph Koshybelow, and
1714571317aSJoseph Koshy.Xr termcap 5 .
172afe61c15SRodney W. Grimes.It Ev TERMPATH
173afe61c15SRodney W. GrimesA sequence of pathnames of termcap files, separated by colons or spaces,
1745203edcdSRuslan Ermilovwhich are searched for terminal descriptions in the order listed.
1755203edcdSRuslan ErmilovHaving
176afe61c15SRodney W. Grimesno
177afe61c15SRodney W. Grimes.Ev TERMPATH
178afe61c15SRodney W. Grimesis equivalent to a
179afe61c15SRodney W. Grimes.Ev TERMPATH
180afe61c15SRodney W. Grimesof
181afe61c15SRodney W. Grimes.Dq Pa $HOME/.termcap:/etc/termcap .
182afe61c15SRodney W. Grimes.Ev TERMPATH
183afe61c15SRodney W. Grimesis ignored if
184afe61c15SRodney W. Grimes.Ev TERMCAP
185afe61c15SRodney W. Grimescontains a full pathname.
186afe61c15SRodney W. Grimes.It Ev TMPDIR
187afe61c15SRodney W. GrimesThe directory in which to store temporary files.
188afe61c15SRodney W. GrimesMost applications use either
189afe61c15SRodney W. Grimes.Dq /tmp
190afe61c15SRodney W. Grimesor
191afe61c15SRodney W. Grimes.Dq /var/tmp .
192afe61c15SRodney W. GrimesSetting this variable will make them use another directory.
193afe61c15SRodney W. Grimes.It Ev TZ
194afe61c15SRodney W. GrimesThe timezone to use when displaying dates.
195afe61c15SRodney W. GrimesThe normal format is a pathname relative to
196edf0e5b3SMike Pritchard.Dq Pa /usr/share/zoneinfo .
197afe61c15SRodney W. GrimesFor example, the command
1987ae31dc9SWolfram Schneider.Dq env TZ=America/Los_Angeles date
199afe61c15SRodney W. Grimesdisplays the current time in California.
200afe61c15SRodney W. GrimesSee
201afe61c15SRodney W. Grimes.Xr tzset 3
202afe61c15SRodney W. Grimesfor more information.
203afe61c15SRodney W. Grimes.It Ev USER
204afe61c15SRodney W. GrimesThe login name of the user.
205afe61c15SRodney W. Grimes.El
206afe61c15SRodney W. Grimes.Pp
207afe61c15SRodney W. GrimesFurther names may be placed in the environment by the
208f06471d4SPhilippe Charnier.Ic export
209afe61c15SRodney W. Grimescommand and
210afe61c15SRodney W. Grimes.Ar name=value
211afe61c15SRodney W. Grimesarguments in
212afe61c15SRodney W. Grimes.Xr sh 1 ,
213afe61c15SRodney W. Grimesor by the
214f06471d4SPhilippe Charnier.Ic setenv
215afe61c15SRodney W. Grimescommand if you use
216afe61c15SRodney W. Grimes.Xr csh 1 .
217afe61c15SRodney W. GrimesIt is unwise to change certain
218afe61c15SRodney W. Grimes.Xr sh 1
219afe61c15SRodney W. Grimesvariables that are frequently exported by
220afe61c15SRodney W. Grimes.Pa .profile
221afe61c15SRodney W. Grimesfiles, such as
222afe61c15SRodney W. Grimes.Ev MAIL ,
223afe61c15SRodney W. Grimes.Ev PS1 ,
224afe61c15SRodney W. Grimes.Ev PS2 ,
225afe61c15SRodney W. Grimesand
226afe61c15SRodney W. Grimes.Ev IFS ,
227afe61c15SRodney W. Grimesunless you know what you are doing.
228f87fc6e3SGiorgos Keramidas.Pp
229f87fc6e3SGiorgos KeramidasThe current environment variables can be printed with
230f87fc6e3SGiorgos Keramidas.Xr env 1 ,
231f87fc6e3SGiorgos Keramidas.Xr set 1
232f87fc6e3SGiorgos Keramidasor
233f87fc6e3SGiorgos Keramidas.Xr printenv 1
234f87fc6e3SGiorgos Keramidasin
235f87fc6e3SGiorgos Keramidas.Xr sh 1
236f87fc6e3SGiorgos Keramidasand
237f87fc6e3SGiorgos Keramidas.Xr env 1 ,
238f87fc6e3SGiorgos Keramidas.Xr printenv 1
239f87fc6e3SGiorgos Keramidasor the
240f87fc6e3SGiorgos Keramidas.Cm printenv
241f87fc6e3SGiorgos Keramidasbuilt-in command in
242f87fc6e3SGiorgos Keramidas.Xr csh 1 .
243afe61c15SRodney W. Grimes.Sh SEE ALSO
244c15a12dfSWolfram Schneider.Xr cd 1 ,
245afe61c15SRodney W. Grimes.Xr csh 1 ,
246d0930e86SJens Schweikhardt.Xr env 1 ,
247afe61c15SRodney W. Grimes.Xr ex 1 ,
248afe61c15SRodney W. Grimes.Xr login 1 ,
249f87fc6e3SGiorgos Keramidas.Xr printenv 1 ,
250afe61c15SRodney W. Grimes.Xr sh 1 ,
251afe61c15SRodney W. Grimes.Xr execve 2 ,
252afe61c15SRodney W. Grimes.Xr execle 3 ,
253370cbbf2SGreg Lehey.Xr getbsize 3 ,
2546ae0d91aSBaptiste Daroussin.Xr getenv 3 ,
255e0a5f02bSMaxim Sobolev.Xr setenv 3 ,
2567c2aa513SAndrey A. Chernov.Xr setlocale 3 ,
257afe61c15SRodney W. Grimes.Xr system 3 ,
258afe61c15SRodney W. Grimes.Xr termcap 3 ,
259afe61c15SRodney W. Grimes.Xr termcap 5
260afe61c15SRodney W. Grimes.Sh HISTORY
261afe61c15SRodney W. GrimesThe
2624b66483fSRuslan Ermilov.Nm
263afe61c15SRodney W. Grimesmanual page appeared in
264*8209febbSSergio Carlavilla Delgado.At v7 .
265