Skip to main content
added 433 characters in body
Source Link
Timo
  • 6.5k
  • 1
  • 28
  • 30

The PATH before = is a variable name and the combination tells bash to store the stuff behind the = in the variable.
The $PATH is the value of the variable PATH up until then.

The combination PATH="some_path_to_stuff:$PATH" extends the PATH variable. In bash this is a colon (:) separated list.


Regarding the double addition of /usr/local/bin, I can only guess that the second version has no newline after it (and is at the end of the file). In principle this should give you a PATH which starts with /usr/local/bin:/usr/local/bin:..... You can check that with

echo $PATH 

And if there is only one time /usr/local/bin then do:

echo "" >> ~/.bash_profile 

and login an try to print $PATH again.

The PATH before = is a variable name and the combination tells bash to store the stuff behind the = in the variable.
The $PATH is the value of the variable PATH up until then.

The combination PATH="some_path_to_stuff:$PATH" extends the PATH variable. In bash this is a colon (:) separated list.

The PATH before = is a variable name and the combination tells bash to store the stuff behind the = in the variable.
The $PATH is the value of the variable PATH up until then.

The combination PATH="some_path_to_stuff:$PATH" extends the PATH variable. In bash this is a colon (:) separated list.


Regarding the double addition of /usr/local/bin, I can only guess that the second version has no newline after it (and is at the end of the file). In principle this should give you a PATH which starts with /usr/local/bin:/usr/local/bin:..... You can check that with

echo $PATH 

And if there is only one time /usr/local/bin then do:

echo "" >> ~/.bash_profile 

and login an try to print $PATH again.

Source Link
Timo
  • 6.5k
  • 1
  • 28
  • 30

The PATH before = is a variable name and the combination tells bash to store the stuff behind the = in the variable.
The $PATH is the value of the variable PATH up until then.

The combination PATH="some_path_to_stuff:$PATH" extends the PATH variable. In bash this is a colon (:) separated list.