Bash Environment



When a program is invoked it is given an array of strings called the environment.

This is a list of name-value pairs, of the form NAME=value.

Info! You should read this message.

Bash provides several ways to manipulate the environment. On invocation, the shell scans its own environment and creates a parameter for each name found, automatically marking it for export to child processes.

Executed commands inherit the environment.
The export and `declare -x' commands allow parameters and functions to be added to and deleted from the environment.

If the value of a parameter in the environment is modified, the new value becomes part of the environment, replacing the old.

The environment inherited by any executed command consists of the shell's initial environment, whose values can be modified in the shell, less any pairs removed by the unset and `export -n' commands, plus any additions via the export and `declare -x' commands.

The environment for any simple command or function can be augmented temporarily by prefixing it with parameter assignments, as described in section Shell Parameters. These assignment statements affect only the environment seen by that command.

If the `-k' option is set (see the Set Builtin), then all parameter assignments are placed in the environment for a command, not just those that precede the command name.

When Bash invokes an external command, the variable `$_' is set to the full path name of the command and passed to that command in its environment.

Danger! You should read this message.


Leave a Comment:
Commenter Name
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Commenter Name
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Commenter Name
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Commenter Name
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
Search
Side Widget
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!