Yesterday, I learned quite a lot about different kinds of shells in terms of history, developer, current state and etc. I decided to use bash as my main terminal shell with no hesitation after my researches. However, I found that my bash was of a really old version on my mac. I decided to upgrade it. Here is how I did it.
Install Homebrew, which is a package manager for Mac OS X. It can help to install a lot of useful packages that are omitted by Apple.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Use Homebrew to install the newest version of bash (4.2.45)
brew install bash
The executable file will be placed under
/usr/local/bin/bash, so add
/etc/shellsby your favorite text editor. Don’t forget to use
sudo vi /etc/shells
Change your shell
Change the line that has Shell to the location that your newly brew installed bash is located.
Restart your terminal
Verify the version of your bash shell