Updating Bash for OSX - AaronV77/Monday GitHub Wiki
Here are the steps in order to get your Bash updated on Mac OSX:
- Do the following to get the starting version: echo $BASH_VERSION .
- Go to the following website to install brew. Brew is a package manage for OSX and it makes life easy. Here is the link for their website: https://brew.sh/. All you should have to do is run the 'ruby' command at the very top of the page.
- Open up a terminal and type the following: brew install bash. The system will install the new version of bash to the following areas: /usr/local/bin/bash (symbolic link) and /usr/local/Cellar/bash/5.0.2/bin/bash (package).
- Execute the following command: echo "usr/local/bin/bash" >> /etc/shells . This will add the shell to the system file that and whitelist it.
- From here there are two different things that you can do. If you are on a company system then just go to the terminal preferences and change the following setting 'Shells open with:' to 'usr/local/bin/bash' or you can try the following commands sudo chsh -s usr/local/bin/bash (for root) and chsh -s usr/local/bin/bash . You will need a password for either one.
- If the last command worked then do the following two commands as well: sudo rm -f /bin/bash and sudo ln -s /usr/local/bin/bash /bin/bash .
- Restart the terminal and boom you should have an updated Bash shell. Do the following command again to check if the version is the same: echo $BASH_VERSION . If you continue to keep having problems with your Bash then you might have to change your path.
Helpful link: https://itnext.io/upgrading-bash-on-macos-7138bd1066ba