Friday, 7 February 2014

Updated Your Bash Shell in OSX

Are you a Bash shell user on OSX? (by default you are!)  Well, did you realize that Bash is at version 3.2.51 on Mavericks, 10.9.1?   I hit a wall when I realized some of my dotfiles were not going to run as expected with this older version.

No worries - since I use the fantastic Homebrew package manager for OSX, installing Bash 4.2.45 was a simple:
    brew install bash
Thats not the end of the story though.  Now you have to change your login shell on OSX.

First step after installing is to edit /etc/shells, and add /usr/local/bin/bash to the top of the list:
    sudo vi /etc/shells
Being a nerd, you know you can just to change your shell:
    chsh -s /usr/local/bin/bash
Or you can go to System Preferences, then Ctrl-Click on your Users & Groups user profile (ensuring screen is unlocked):


And finally, after selecting Advanced Options, just change the shell to /usr/local/bin/bash:


If you want to be sure it worked, just do this in a new terminal:

    echo $SHELL



No comments:

Post a Comment