$PATH contains a
:-separated list of places where bash (the shell/terminal) should check for a program.
For example if you type
cat the way the terminal understands what that means is to look through the first, second, third elements of
$PATH, then save the first location it finds for later invocations of
If I have two different versions of a program in two different places, with one of them being preferred, and
$PATH tells the shell to search in the wrong order, then there's a problem. Otherwise, no problem.
Open a terminal and type
You'll see that
a=5 set the variable value and
$a refers to the variable name, not the value.
Open a second terminal and type
echo $a. It should again be blank.
The difference between
export and assignment (
=) is explained here: https://stackoverflow.com/questions/1158091/defining-a-variable-with-or-without-export.