11

I'm trying to update bash shell on my Mac OS Mavericks.

$ brew install bash
$ which -a bash
/bin/bash
/usr/local/bin/bash

$ which bash
/bin/bash

$ chsh -s /usr/local/bin/bash
$ which bash
/bin/bash

In Terminal's preference: Shells open with -> Command (complete path) : /usr/local/bin/bash.

But still, I cannot switch to brew-installed bash shell. What can I do?

0

1 Answer 1

25

From the chsh manual:

When altering a login shell, and not the super-user, the user may not change from a non-standard shell or to a non-standard shell. Non-standard is defined as a shell not found in /etc/shells.

So you can either run chsh as root

sudo chsh -s /usr/local/bin/bash "$USER"

or add /usr/local/bin/bash to /etc/shells to make it a "standard shell"

echo /usr/local/bin/bash | sudo tee -a /etc/shells
chsh -s /usr/local/bin/bash

Note that the fact that which bash still points to /bin/bash does not mean your shell has not been changed, it just means /bin is before /usr/local/bin in your $PATH.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.