Working with environment variables
Environmental variables are inherited by any subshells or child processes. For example, HOME, PATH
. Every shell terminal has the memory area called environment. Shell keeps all details and settings in the environment. When we start a new terminal or shell, this environment is created every time.
We can view environment variables by the following command:
$ env
Or:
$ printenv
Output:
This is the output of the $ env
command. The list of environment variables will be quite extensive. I advise you to browse through the complete list. We can change the content of any of these environment variables.
Environmental variables are defined in a terminal or shell. They will be available in subshells or child shells created from the current shell terminal. You will learn about these activities in the next few sections. You have already learned that every command in shell creates a new subshell from the current shell.
The following is a brief summary of the few environmental...