Notes
Upgrade to Bash 4 on macOS
upgrading from the old Bash 3.2 on macOS to Bash 4 with Homebrew, adding it to /etc/shells and making it the default shell with chsh.
Bash Scripting
1# install Homebrew
2# /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3
4# install Bash via Homebrew
5brew update && brew install bash
6
7# Add the new shell to the list of allowed (white-listed) shells
8# sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
9echo "$(brew --prefix)/bin/bash" >> /etc/shells
10
11# Change to the new shell
12chsh -s $(brew --prefix)/bin/bash
sudo -ilet’s you switch torootuserbrew --prefixgives you the location of Homebrew install directory (/usr/localby default)cat /etc/shellsgives you the list of allowed shells