Local and Environment Variables
Variables are prefixed by a dollar sign (
A value is assigned to a variable through an equals sign (
(no whitespace on either side of it).
MY_VARIABLE='my value' echo $MY_VARIABLE
By default, variables are seen only within the shell itself. To pass variables to other programs invoked within the shell, they have to be exported to the environment.
- Display ot set shell variables.
- Display environment variables.
- Run a program in a modified environment.
- Export a local variable to the environment.