DragonFly On-Line Manual Pages
PRINTENV(1) DragonFly General Commands Manual PRINTENV(1)
printenv, env -- print out the environment, set and print environment
env [-] [-i] [name=value ...] [utility [argument ...]]
The printenv utility prints out the names and values of the variables in
the environment, with one name/value pair per line. If name is speci-
fied, only its value is printed.
Some shells may provide a builtin printenv command which is similar or
identical to this utility. Consult the builtin(1) manual page.
The env utility executes utility after modifying the environment as spec-
ified on the command line. The option name=value specifies an environ-
ment variable, name, with a value of value.
The options are as follows:
-i Execute the utility with only those environment values specified.
The environment inherited by env is ignored completely.
- Identical to the -i option, available for backward compatibility.
If no utility is specified, env prints out the names and values of the
variables in the environment, with one name/value pair per line.
The env utility is sometimes useful with the ``#!'' construct (see
execve(2)). The only difference between ``#!/usr/local/bin/foo'' and
``#!/usr/bin/env /usr/local/bin/foo'' is that the latter works even if
/usr/local/bin/foo is itself interpreted. Using env this way also allows
one to reference foo without the path, as well as set up the environment
The printenv utility exits 0 on success, and >0 if an error occurs.
The env utility exits 0 on success, and >0 if an error occurs. An exit
status of 126 indicates utility was found, but could not be executed. An
exit status of 127 indicates utility could not be found.
csh(1), sh(1), execvp(3), environ(7)
The env utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
The printenv command appeared in 3.0BSD.
The env utility doesn't handle utility arguments with equal (``='') signs
in their names, for obvious reasons.
DragonFly 3.5 June 6, 1993 DragonFly 3.5