Fixing Mac .bash_profile
Murphy, who was he and why is his law so recurrent? Apparently, there are people who spend an inordinate amount of time unpacking the history of Murphy's Law. Myself, I typically use a liberal helping of my best sailor's vocabulary when encountering his annoying law, but never really stopped to think about where it came from. That, however, is not the point of this post.
Encountering Edward Murphy's annoying law, not surprisingly, occurs more often than not when working with computers. On a Mac, which, under all the fancy user interface, is still mostly a Unix machine, means you invariably will dork up the ~/.bash_profile
at some point. Once this happens, you loose access to all the commands needed to interact with the command line, and begin to curse Mr. Edward Murphy himself with prolific intensity.
Thankfully, there is a path forward. You can temporarally set the PATH, so you gain access to the normal bash commands, and can get back in to fix whatever you just broke in ~/.bash_profile
.
Simply use this command...
export PATH=/bin:/usr/bin:/usr/local/bin
...and you will again be able to have access to common bash commands.
Edward - 0
You - 1
Winning, for now.