01 / 06
You are already using variables
This chapter is about what happens to what you type before it reaches the command. Start with variables.
You are using them already.
~ $ cd ~~ $ echo $HOME/home/learner$HOME is a container with the place of your room in it. ~ points at the same thing.
Others are in there from the start.
| Name | Contents |
|---|---|
HOME | your own room |
USER | your own name |
PATH | where commands are looked for |
PWD | where you are |
SHELL | the shell you are using |
The important part is that it is not the command that replaces $HOME.
echo $HOME | the shell rewrites it firstecho /home/learner | this is what reaches echoecho has never even seen the characters $HOME. The shell is interpreting. That view is the whole of chapter 10.