Upgrading to Bash 4 on MacOS [Snippet]

#ICYMI: Incredibly, macOS Mojave comes with Bash 3.22 by default still. Apparently this is due to licensing reasons, however Bash 4 has lots of lovely features including associative arrays that I’d like use. Hence, after reading on the internet for a bit, I’ve installed it on my Mac. This turned out to require just 3 commands: $ brew install bash $ sudo bash -c ‘echo /usr/local/bin/bash >> /etc/shells’ $ chsh -s /usr/local/bin/bash

Close the terminal and open a new one, which now has Bash 4! https://goo.gl/8fVDut