Bash Environment Variable
An environment variable is a variable that the shell passes on to every program it starts. Common ones are HOME, PATH and USER.
A normal variable stays in the current shell. Use export to turn it into an environment variable.
Read an environment variable
echo "Your home is $HOME"
Your home is /home/user
Pass a variable to a new shell
bash -c starts a new shell, which only sees exported variables:
export GREETING="Hi"
bash -c 'echo $GREETING'
Hi