Displays the current environment or sets the environment for the execution of a command.
env [ -i |- ] [Name=Value ]... [Command [ Argument ... ] ]
env [Name]
The env command allows you to display your current environment or run a specified command in a changed environment.
If no flags or parameters are specified, the env command displays your current environment, showing one Name=Value pair per line.
-i | Ignores the inherited environment and invokes the command specified by the Command parameter with the environment specified by the Name=Value parameters. |
- | Obsolete flag. Use the -i flag. |
If the Command parameter is specified, the exit status of the env command is the exit status of the command specified in the Command parameter. Otherwise, the env command exits with one of the following values:
TZ=MST7MDT dateOR
env TZ=MST7MDT dateEach of these commands displays the time in mountain time and the current date. The two commands shown are equivalent. When the date command is finished, the previous value of the TZ environment variable takes effect again.
env -i PATH=$PATH IDIR=/$HOME/include LIBDIR=/$HOME/lib makeYou must specify the PATH environment variable so that the shell can find the make command. When the make command is finished, the previous environment takes effect.
/usr/bin/env | Contains the env command. |
The printenv command, ksh command.
The environment file.
The profile file format.
The exec subroutines.
Commands Overview in AIX Version 4.3 System User's Guide: Operating System and Devices.
Profiles Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.
Shells Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.