Apple - How to use bash as default shell
brew install bash
sudo nano /etc/shells
# add to last line
/usr/local/bin/bash
# save and quit via kntrl + x
Now, you need to see something like this:
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.
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/bash # we added this!
Now set your default shell:
chsh -s /usr/local/bin/bash $USER # this will set for the current user.
Now quit Terminal and re-open it! Check if all ok?
echo $BASH_VERSION # 4.3.42(1)-release
You can use the chsh command to change your shell. In your case, with brew generated bash, you should set it to /usr/local/bin/bash
. You should also put this in /etc/shells
.
As to your question echo $BASH_VERSION
will tell you the version of the current shell. bash --version
tells you the version of the first bash in your $PATH
. So the way you were looking at the version was not telling you the version that you were running.