Skip to content
Advertisement

All bash commands lost after sourcing bash_profile after osx upgrade

I recently upgraded my osx to os x el capitan. I noticed that subl command was missing so I tried adding the path to my bash_profile. It didn’t work out so I removed it and then do a source ~/.bash_profile and now all of my bash commands are gone.

Here is my bash_profile file

JavaScript

and when I do export $PATH

I am getting this

31-34-238:bin judyngai$ export $PATH -bash: export: `/usr/local/bin:/usr/local/sbin:': not a valid identifier

I cd into all of the directories that its getting searched through /usr/local/bin, /bin, /usr/local/bin etc. and saw all of the commands in there.

and this

JavaScript

I actually think my bash_profile is fine so what is wrong? Rbenv and macport both look fine.

Advertisement

Answer

This line is destroying your path: export PATH=/usr/local/sbin:$path — variables are case sensitive.

However, this error

JavaScript

Indicates you probably have this in your bash_profile

JavaScript

Where you are substituting the variable on the left-hand side instead of providing the variable name.

You export a variable (name), not a variable’s value.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement