CLI Variables
Jump to navigation
Jump to search
Assignment and Dereferencing
To assign a value to an environment variable you simply type the variable name, '=', then the value. For example,
FOO=Rob BAR=Love
To get the value of the variable (i.e. dereference) you place a '$' before the variable name.
#echo $FOO #Rob #echo $BAR #Love
Commands
env = Shows you the environment variables that are currently defined. echo = Displays a line of text.
Quiz
- What is the value of the "HOME" environment variable?
- How would you create an environment variable named GEEK that's contents are "FREE GEEK is the best!"?