Upgrade your bash in macOS

Upgrade your bash in macOS

Update:

Use the following command is much more effective!

1
chsh -s /usr/local/bin/bash

Below is the original post:

1
brew install bash # install the 5.0 version bash with `brew`:

Then, edit the /etc/shells file and add the 5.0 version bash's PATH on the top of the shells:

1
2
3
4
5
6
7
8
9
10
11
12
13
➜ cat /etc/shells 
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/usr/local/bin/bash
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh