Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

env(1) OSS Shell and Utilities Reference Manual
NAME
env - Displays or sets environment variables
SYNOPSIS
env [-i][-][name=value ...] [command][argument ...]
FLAGS
-i Invokes command with the environment specied by the arguments; the env command
ignores the inherited environment.
- Invokes command with the environment specied by the arguments; the env command
ignores the inherited environment. (Obsolescent)
DESCRIPTION
The env command lets you get and change your current environment and then run the specied
command with the changed environment. Changes in the form name=value are added to the
current environment before the command is run. If the -i ag is used, the current environment is
ignored, and the command runs with only the changed environment. Changes are only in effect
while the specied command is running.
If command is not specied, the env command displays your current environment one name=value
pair per line.
EXAMPLES
1. To replace one environment with another one, enter:
env - PATH=$PATH IDIR=/u/jim/include LIBDIR=/u/jim/lib make
This command runs the make command in an environment that consists only of these
denitions for the PATH, IDIR, and LIBDIR parameters. You must redene PATH so
that the shell can nd the make command.
When make is nished, the original environment takes effect again.
EXIT VALUES
The env command exits with the following values:
0 (zero) The env command completed successfully.
1-125 An error occurred in the env command.
126 The specied utility was found but could not be invoked.
127 The specied utility could not be found.
RELATED INFORMATION
Commands: sh(1).
Functions: exec(2).
3104 Hewlett-Packard Company 527188-004