1994-05-30 19:09:18 +00:00
|
|
|
.\" Copyright (c) 1983, 1990, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2014-03-14 03:07:51 +00:00
|
|
|
.\" 3. Neither the name of the University nor the names of its contributors
|
1994-05-30 19:09:18 +00:00
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)environ.7 8.3 (Berkeley) 4/19/94
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1994-05-30 19:09:18 +00:00
|
|
|
.\"
|
2003-04-12 05:20:15 +00:00
|
|
|
.Dd April 12, 2003
|
1994-05-30 19:09:18 +00:00
|
|
|
.Dt ENVIRON 7
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1994-05-30 19:09:18 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm environ
|
|
|
|
.Nd user environment
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Ar extern char **environ ;
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
An array of strings called the
|
|
|
|
.Ar environment
|
|
|
|
is made available by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr execve 2
|
|
|
|
when a process begins.
|
|
|
|
By convention these strings have the form
|
1994-05-30 19:09:18 +00:00
|
|
|
.Dq Ar name=value .
|
|
|
|
The following names are used by various commands:
|
2003-04-12 05:20:15 +00:00
|
|
|
.Bl -tag -width LC_MONETARY
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev BLOCKSIZE
|
|
|
|
The size of the block units used by several commands, most notably
|
|
|
|
.Xr df 1 ,
|
|
|
|
.Xr du 1
|
|
|
|
and
|
|
|
|
.Xr ls 1 .
|
2012-11-16 01:43:23 +00:00
|
|
|
This variable is processed by the
|
|
|
|
.Xr getbsize 3
|
|
|
|
function.
|
2002-06-07 00:45:06 +00:00
|
|
|
.It Ev COLUMNS
|
|
|
|
The user's preferred width in column positions for the terminal.
|
|
|
|
Utilities such as
|
|
|
|
.Xr ls 1
|
|
|
|
and
|
|
|
|
.Xr who 1
|
|
|
|
use this to format output into columns.
|
|
|
|
If unset or empty, utilities will use an
|
|
|
|
.Xr ioctl 2
|
|
|
|
call to ask the terminal driver for the width.
|
1999-08-18 19:53:04 +00:00
|
|
|
.It Ev EDITOR
|
|
|
|
Default editor name.
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev EXINIT
|
|
|
|
A startup list of commands read by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr ex 1
|
1994-05-30 19:09:18 +00:00
|
|
|
and
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr vi 1 .
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev HOME
|
|
|
|
A user's login directory, set by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr login 1
|
1994-05-30 19:09:18 +00:00
|
|
|
from the password file
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr passwd 5 .
|
1995-11-02 12:53:26 +00:00
|
|
|
.It Ev LANG
|
1996-04-08 04:18:31 +00:00
|
|
|
This variable configures all programs which use
|
1996-04-07 00:06:21 +00:00
|
|
|
.Xr setlocale 3
|
2004-01-31 23:29:20 +00:00
|
|
|
to use the specified locale unless the
|
|
|
|
.Ev LC_*
|
|
|
|
variables are set.
|
2003-04-12 05:20:15 +00:00
|
|
|
.It Ev LC_ALL
|
|
|
|
Overrides the values of
|
|
|
|
.Ev LC_COLLATE ,
|
|
|
|
.Ev LC_CTYPE ,
|
|
|
|
.Ev LC_MESSAGES ,
|
|
|
|
.Ev LC_MONETARY ,
|
2004-01-31 23:29:20 +00:00
|
|
|
.Ev LC_NUMERIC ,
|
|
|
|
.Ev LC_TIME
|
2003-04-12 05:20:15 +00:00
|
|
|
and
|
2004-01-31 23:29:20 +00:00
|
|
|
.Ev LANG .
|
2003-04-12 05:20:15 +00:00
|
|
|
.It Ev LC_COLLATE
|
|
|
|
Locale to be used for ordering of strings.
|
|
|
|
.It Ev LC_CTYPE
|
|
|
|
Locale to be used for character classification
|
|
|
|
(letter, space, digit, etc.) and for interpreting byte sequences as
|
|
|
|
multibyte characters.
|
|
|
|
.It Ev LC_MESSAGES
|
|
|
|
Locale to be used for diagnostic messages.
|
|
|
|
.It Ev LC_MONETARY
|
|
|
|
Locale to be used for interpreting monetary input
|
|
|
|
and formatting output.
|
|
|
|
.It Ev LC_NUMERIC
|
|
|
|
Locale to be used for interpreting numeric input and
|
|
|
|
formatting output.
|
|
|
|
.It Ev LC_TIME
|
|
|
|
Locale to be used for interpreting dates input and
|
|
|
|
for formatting output.
|
1997-03-08 14:41:44 +00:00
|
|
|
.It Ev MAIL
|
|
|
|
The location of the user's
|
2001-07-14 19:41:16 +00:00
|
|
|
mailbox instead of the default in /var/mail,
|
1997-03-08 14:41:44 +00:00
|
|
|
used by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr mail 1 ,
|
1997-03-08 14:41:44 +00:00
|
|
|
.Xr sh 1 ,
|
2006-12-14 13:37:08 +00:00
|
|
|
and many other mail clients.
|
2003-04-12 05:20:15 +00:00
|
|
|
.It Ev NLSPATH
|
|
|
|
List of directories to be searched for the message catalog referred to by
|
|
|
|
.Ev LC_MESSAGES .
|
|
|
|
See
|
|
|
|
.Xr catopen 3 .
|
1999-08-18 19:53:04 +00:00
|
|
|
.It Ev PAGER
|
2004-07-03 18:29:24 +00:00
|
|
|
Default paginator program.
|
|
|
|
The program specified by this variable is used by
|
1999-08-18 19:53:04 +00:00
|
|
|
.Xr mail 1 ,
|
|
|
|
.Xr man 1 ,
|
|
|
|
.Xr ftp 1 ,
|
|
|
|
etc, to display information which is longer than the current display.
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev PATH
|
|
|
|
The sequence of directories, separated by colons, searched by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr csh 1 ,
|
|
|
|
.Xr sh 1 ,
|
|
|
|
.Xr system 3 ,
|
|
|
|
.Xr execvp 3 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
etc, when looking for an executable file.
|
2001-07-14 19:41:16 +00:00
|
|
|
.Ev PATH
|
1996-04-08 04:18:31 +00:00
|
|
|
is set to ``/usr/bin:/bin'' initially by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr login 1 .
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev PRINTER
|
|
|
|
The name of the default printer to be used by
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr lpr 1 ,
|
|
|
|
.Xr lpq 1 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
and
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr lprm 1 .
|
1999-08-18 19:53:04 +00:00
|
|
|
.It Ev PWD
|
|
|
|
The current directory pathname.
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev SHELL
|
|
|
|
The full pathname of the user's login shell.
|
|
|
|
.It Ev TERM
|
|
|
|
The kind of terminal for which output is to be prepared.
|
|
|
|
This information is used by commands, such as
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr nroff 1
|
1994-05-30 19:09:18 +00:00
|
|
|
or
|
|
|
|
.Xr plot 1
|
2004-07-03 18:29:24 +00:00
|
|
|
which may exploit special terminal capabilities.
|
|
|
|
See
|
1994-05-30 19:09:18 +00:00
|
|
|
.Pa /usr/share/misc/termcap
|
|
|
|
.Pq Xr termcap 5
|
|
|
|
for a list of terminal types.
|
|
|
|
.It Ev TERMCAP
|
1996-04-08 04:18:31 +00:00
|
|
|
The string describing the terminal in
|
2001-07-14 19:41:16 +00:00
|
|
|
.Ev TERM ,
|
1996-04-08 04:18:31 +00:00
|
|
|
or, if
|
1994-05-30 19:09:18 +00:00
|
|
|
it begins with a '/', the name of the termcap file.
|
|
|
|
See
|
|
|
|
.Ev TERMPATH
|
1999-02-04 07:13:49 +00:00
|
|
|
below, and
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr termcap 5 .
|
1994-05-30 19:09:18 +00:00
|
|
|
.It Ev TERMPATH
|
|
|
|
A sequence of pathnames of termcap files, separated by colons or spaces,
|
2004-07-03 18:29:24 +00:00
|
|
|
which are searched for terminal descriptions in the order listed.
|
|
|
|
Having
|
1994-05-30 19:09:18 +00:00
|
|
|
no
|
|
|
|
.Ev TERMPATH
|
|
|
|
is equivalent to a
|
|
|
|
.Ev TERMPATH
|
|
|
|
of
|
|
|
|
.Dq Pa $HOME/.termcap:/etc/termcap .
|
|
|
|
.Ev TERMPATH
|
|
|
|
is ignored if
|
|
|
|
.Ev TERMCAP
|
|
|
|
contains a full pathname.
|
|
|
|
.It Ev TMPDIR
|
|
|
|
The directory in which to store temporary files.
|
|
|
|
Most applications use either
|
|
|
|
.Dq /tmp
|
|
|
|
or
|
|
|
|
.Dq /var/tmp .
|
|
|
|
Setting this variable will make them use another directory.
|
|
|
|
.It Ev TZ
|
|
|
|
The timezone to use when displaying dates.
|
|
|
|
The normal format is a pathname relative to
|
1996-04-08 04:18:31 +00:00
|
|
|
.Dq Pa /usr/share/zoneinfo .
|
1994-05-30 19:09:18 +00:00
|
|
|
For example, the command
|
1996-11-30 00:29:51 +00:00
|
|
|
.Dq env TZ=America/Los_Angeles date
|
1994-05-30 19:09:18 +00:00
|
|
|
displays the current time in California.
|
|
|
|
See
|
|
|
|
.Xr tzset 3
|
|
|
|
for more information.
|
|
|
|
.It Ev USER
|
|
|
|
The login name of the user.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Further names may be placed in the environment by the
|
2003-06-08 13:33:50 +00:00
|
|
|
.Ic export
|
1994-05-30 19:09:18 +00:00
|
|
|
command and
|
|
|
|
.Ar name=value
|
|
|
|
arguments in
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr sh 1 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
or by the
|
2003-06-08 13:33:50 +00:00
|
|
|
.Ic setenv
|
1994-05-30 19:09:18 +00:00
|
|
|
command if you use
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr csh 1 .
|
1994-05-30 19:09:18 +00:00
|
|
|
It is unwise to change certain
|
2004-07-03 18:29:24 +00:00
|
|
|
.Xr sh 1
|
1994-05-30 19:09:18 +00:00
|
|
|
variables that are frequently exported by
|
|
|
|
.Pa .profile
|
|
|
|
files, such as
|
|
|
|
.Ev MAIL ,
|
|
|
|
.Ev PS1 ,
|
|
|
|
.Ev PS2 ,
|
|
|
|
and
|
|
|
|
.Ev IFS ,
|
|
|
|
unless you know what you are doing.
|
2005-08-17 13:02:47 +00:00
|
|
|
.Pp
|
|
|
|
The current environment variables can be printed with
|
|
|
|
.Xr env 1 ,
|
|
|
|
.Xr set 1
|
|
|
|
or
|
|
|
|
.Xr printenv 1
|
|
|
|
in
|
|
|
|
.Xr sh 1
|
|
|
|
and
|
|
|
|
.Xr env 1 ,
|
|
|
|
.Xr printenv 1
|
|
|
|
or the
|
|
|
|
.Cm printenv
|
|
|
|
built-in command in
|
|
|
|
.Xr csh 1 .
|
1994-05-30 19:09:18 +00:00
|
|
|
.Sh SEE ALSO
|
1997-01-09 21:04:10 +00:00
|
|
|
.Xr cd 1 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
.Xr csh 1 ,
|
2004-02-29 13:10:09 +00:00
|
|
|
.Xr env 1 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
.Xr ex 1 ,
|
|
|
|
.Xr login 1 ,
|
2005-08-17 13:02:47 +00:00
|
|
|
.Xr printenv 1 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
.Xr sh 1 ,
|
|
|
|
.Xr execve 2 ,
|
|
|
|
.Xr execle 3 ,
|
2012-11-16 01:43:23 +00:00
|
|
|
.Xr getbsize 3 ,
|
2014-12-26 22:43:54 +00:00
|
|
|
.Xr getenv 3 ,
|
2001-01-01 23:26:54 +00:00
|
|
|
.Xr setenv 3 ,
|
1995-10-12 23:54:35 +00:00
|
|
|
.Xr setlocale 3 ,
|
1994-05-30 19:09:18 +00:00
|
|
|
.Xr system 3 ,
|
|
|
|
.Xr termcap 3 ,
|
|
|
|
.Xr termcap 5
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-05-30 19:09:18 +00:00
|
|
|
manual page appeared in
|
|
|
|
.Bx 4.2 .
|