ENV(1) | User Commands | ENV(1) |
env - set environment for command invocation
/usr/bin/env [-i | -] [name=value]... [utility [arg... ]]
/usr/xpg4/bin/env [-i | -] [name=value]...
[utility [arg... ]]
The env utility obtains the current environment, modifies it according to its arguments, then invokes the utility named by the utility operand with the modified environment.
Optional arguments are passed to utility. If no utility operand is specified, the resulting environment is written to the standard output, with one name=value pair per line.
If env executes commands with arguments, it uses the default shell /usr/bin/sh (see sh(1)).
The following options are supported:
-i | −
The following operands are supported:
name=value
utility
arg
Example 1 Invoking utilities with new PATH values
The following utility:
example% env -i PATH=/mybin mygrep xyz myfile
invokes the utility mygrep with a new PATH value as the only entry in its environment. In this case, PATH is used to locate mygrep, which then must reside in /mybin.
See environ(7) for descriptions of the following environment variables that affect the execution of env: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.
PATH
If utility is invoked, the exit status of env is the exit status of utility. Otherwise, the env utility returns one of the following exit values:
0
1-125
126
127
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
CSI | enabled |
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
CSI | enabled |
Interface Stability | Standard |
ksh(1), sh(1), exec(2), profile(5), attributes(7), environ(7), standards(7)
January 2, 2002 | OmniOS |