Homebrew is generally a bit nicer than MacPorts, as it doesn’t require lots of sudo
action. Here’s an article that guided me to upgrading my install of bash: http://concisionandconcinnity.blogspot.com/2009/03/upgrade-bash-to-40-in-mac-os-x.html
As for steps:
- Install Homebrew from the docs on their homepage
-
Install Git using Homebrew (optional, but nice to have a more up-to-date
git
)brew install git
-
Now install
bash
:brew install bash
-
Add this install of
bash
to the allowed shells list:echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
- Homebrew installs things to
/usr/local/Cellar/
by default, then symlinks any binaries to/usr/local/bin
, so you’ve now got the latestbash
sitting at/usr/local/bin/bash
- Homebrew installs things to
-
Finally, change your shell to use this new one:
chsh -s /usr/local/bin/bash
-
Open a new terminal window/tab, and run these commands to double-check your work:
$ echo $SHELL /usr/local/bin/bash $ echo $BASH_VERSION 4.2.37(2)-release