(coreutils.info)env invocation


Next: nice invocation Prev: chroot invocation Up: Modified command invocation
Enter node , (file) or (file)node

23.2 `env': Run a command in a modified environment
===================================================

`env' runs a command with a modified environment.  Synopses:

     env [OPTION]... [NAME=VALUE]... [COMMAND [ARGS]...]
     env

   Operands of the form `VARIABLE=VALUE' set the environment variable
VARIABLE to value VALUE.  VALUE may be empty (`VARIABLE=').  Setting a
variable to an empty value is different from unsetting it.  These
operands are evaluated left-to-right, so if two operands mention the
same variable the earlier is ignored.

   Environment variable names can be empty, and can contain any
characters other than `=' and ASCII NUL.  However, it is wise to limit
yourself to names that consist solely of underscores, digits, and ASCII
letters, and that begin with a non-digit, as applications like the
shell do not work well with other names.

   The first operand that does not contain the character `=' specifies
the program to invoke; it is searched for according to the `PATH'
environment variable.  Any remaining arguments are passed as arguments
to that program.  The program should not be a special built-in utility
(Note: Special built-in utilities).

   If no command name is specified following the environment
specifications, the resulting environment is printed.  This is like
specifying the `printenv' program.

   The program accepts the following options.  Also see Note: Common
options.  Options must precede operands.

`-u NAME'
`--unset=NAME'
     Remove variable NAME from the environment, if it was in the
     environment.

`-'
`-i'
`--ignore-environment'
     Start with an empty environment, ignoring the inherited
     environment.


   Exit status:

     0   if no COMMAND is specified and the environment is output
     1   if `env' itself fails
     126 if COMMAND is found but cannot be invoked
     127 if COMMAND cannot be found
     the exit status of COMMAND otherwise


automatically generated by info2www version 1.2.2.9