1

On MacOS I installed bash with:

brew install bash

That created /usr/local/Cellar/bash/5.0.18/bin/bash

The command which -a bash reports only /bin/bash. If I close the terminal, reboot, etc. I see the same output.

I added the new bash to /etc/private/shells, then changed my default shell to the new version of bash:

sudo vim /private/etc/shells # added new bash 5.0.18 path
chsh -s /usr/local/Cellar/bash/5.0.18/bin/bash 

Then I rebooted, but I still see:

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

What's wrong?

2
  • What command did you run to see the 3.2.57 version? Simply bash --version? What does echo $BASH_VERSION say? Aug 11, 2020 at 0:51
  • Yep, I used 'bash --version'... right now seems like all working. Thanks! Aug 11, 2020 at 1:00

1 Answer 1

2

brew installs bash in /usr/local/bin so that is what you want to add to $PATH otherwise you'll have to update $PATH every time bash is updated.

Did you also want to make that bash your login shell? Then:

chsh -s /usr/local/bin/bash
3
  • then I'm run brew install bash it's by default install it to /usr/local/Cellar/.... chsh -s /usr/local/bin/bash yep, ofc I tried that Aug 11, 2020 at 0:26
  • Don't forget that the questioner was also not checking the version correctly.
    – JdeBP
    Aug 11, 2020 at 7:37
  • Yes, it installs in /usr/local/Cellar... but you will find that the brew formula creates a soft link in /usr/local/bin that points to the Cellar: ls -l /usr/local/bin/bash lrwxr-xr-x 1 richard admin 30 2020-07-12 00:30 bash -> ../Cellar/bash/5.0.18/bin/bash
    – rr0ss0rr
    Aug 11, 2020 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .