Cannot change bash shell in Mac OS X

6,732

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.

Share:
6,732

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    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?