Unfortunately, Apple has decided to ship an old version of bash shell. When I go back and forth between linux and OSX sometimes I hit minor inconsistencies because of this. One big one is the git-prompt scripts. As such I finally decided to upgrade to version 4 of bash.
It is a very easy process, 2 minutes, and you are on your way. First, though you need homebrew installed and up-to-date.
brew install bash
Add it to Your Shells
You need to add it to your shells which is easy. Add the following line to `/etc/shells`
Change Your Shell
change the line that has Shell to the location that your newly brew installed bash is located.
Close your terminal and open it again.
To see your current version of bash do the following:
It should echo something like `4.2.45(2)-release`
It is that simple. I though it would be hard until I did it.