Hubbry Logo
search
logo
Env
Env
current hub
2016494

Env

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Env

env is a shell command that either reports environment variables or runs a command in a subprocess with modified environment variables. The command is provided in a Unix-like system.

By default, a subprocess inherits the environment variables of the parent process. env supports adding, modifying and removing the copied variables. env can also be used to launch the correct interpreter.[clarification needed] In this usage, the environment is typically not changed. The command does not modify environment variables in the process in which it runs. Mechanisms for doing so include the export command and assigning a name to a value like NAME=value.

The GNU coreutils version was written by Richard Mlynarik, David MacKenzie, and Assaf Gordon. It first appeared in 4.4BSD, and is a part of POSIX.1 (with the -i option only). This version has been extended to handle signals and the current directory.

FreeBSD's version supports a custom search path. Extensions found in both versions include -u, for unsetting variables, and -S, for splitting arguments (mainly in shebang).

The following command line prints the current environment variables to standard output:

The following command line creates a new shell without any environment variables:

The following command line executes the application xcalc such that the variable DISPLAY has value "foo.bar:1.0" so that it shows on the specified display:

This use of env is often unnecessary since most shells support setting environment variables in front of a command like:

See all
User Avatar
No comments yet.