DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

env(C)


env -- set environment for command execution

Syntax

env [ - | -i ] [ name=value ] ... [ command [args] ]

printenv [ - | -i ] [ name=value ] ... [ command [args] ]

Description

The env command obtains the current ``environment'', modifies it according to its arguments, then executes the command with the modified environment. Arguments of the form name are merged into the inherited environment before the command is executed. The - flag causes the inherited environment to be ignored completely, so that the command is executed with exactly the environment specified by the arguments. The -i flag is equivalent to the - flag, but it conforms to the POSIX utility syntax guidelines.

env understands the -- option delimiter.

If no command is specified, the environment is printed, one name-value pair per line.

Exit values

env returns the following values:

0
successful completion

1
too many values in environment

2
unknown option

126
command could be found but not invoked

127
command could not be found

Limitations

The old printenv command was replaced in System V by the env command. The current printenv is a link to env.

Standards conformance

env is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003