Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
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 specified by the arguments; the env command
ignores the inherited environment.
- Invokes command with the environment specified 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 specified
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 flag is used, the current environment is
ignored, and the command runs with only the changed environment. Changes are only in effect
while the specified command is running.
If command is not specified, 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
definitions for the PATH, IDIR, and LIBDIR parameters. You must redefine PATH so
that the shell can find the make command.
When make is finished, 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 specified utility was found but could not be invoked.
127 The specified utility could not be found.
RELATED INFORMATION
Commands: sh(1).
Functions: exec(2).
3−104 Hewlett-Packard Company 527188-007