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?

Andy Dalton
  • 13,654
  • 1
  • 25
  • 45

1 Answers1

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
AdminBee
  • 21,637
  • 21
  • 47
  • 71
rr0ss0rr
  • 332
  • 2
  • 6
  • 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 – Aleksandr Lebedev Aug 11 '20 at 00:26
  • Don't forget that the questioner was _also_ not checking the version correctly. – JdeBP Aug 11 '20 at 07: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 '20 at 20:17