Skip to content

Upgrade bash on OS X

Michael Hulse edited this page Jul 29, 2018 · 1 revision

Default Bash on OS X is:

$ which bash
/bin/bash

Good to know, in case you need to revert.

# Install Bash 4 using homebrew:
$ brew install bash

# Add the new shell to the list of legit shells:
$ sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells"

# Alternatively, open /etc/shells and add it manually:
#$ atom /etc/shells
#$ subl /etc/shells

# Change the shell for the user:
$ chsh -s /usr/local/bin/bash

# Restart your terminal (new window works too), or just restart your computer.

# Check for Bash 4 and /usr/local/bin/bash...
$ echo $BASH && echo $BASH_VERSION

Next steps:

# Now that you’re setup, put this somewhere in your dotfiles to turn on recursive globbing:
shopt -s globstar

# … and, source your dotfiles...
$ source path/to/dotfiles

Now you can double glob your way into distant directories:

cd some/uportal/project/root
cd **/skins

Links:

Clone this wiki locally