Install Newer BASH on macOS
This article gives the steps to install latest homebrew BASH on macOS that is running BASH 3.x.
As of writing this article there wasn't a way to specify an older version of Bash. I got the latest and greatest Homebrew formula which was 5.0.7. Really I wanted 4.4.x to match a client etc. The older version didn't seem to be available (i.e. brew install email@example.com)
- macOS 10.14.5
- Homebrew 2.1.6
List Bash Version
brew update && brew install bash
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
Switch to New Shell
chsh -s /usr/local/bin/bash
Set in Profile (Optional)
I didn't have to add this. It launches 5.0.7 without it for me.
bash -c 'echo chsh -s /usr/local/bin/bash >> $HOME/.bash_profile'