Do to lack of Associative Arrays in Bash (Version < 3) i decided to
install bash from Homebrew.
brew install bash
After installation, you must set your new bash as default bash in to your system. Homebrew installs bash to
/usr/local/bin/
If you wish to check your current bash version, just echo these variables:
echo $BASH_VERSION # gives full version
echo $BASH_VERSINFO # gives major version number
We will use chsh command to proceed but before that, we must add this
new bash location in to /etc/shells. Otherwise, system will alert an error.
Now, lets edit file:
sudo nano /etc/shells
add this line at the end of the list:
/usr/local/bin/bash
Now, we can run chsh command:
chsh -s /usr/local/bin/bash YOUR_USER_NAME
Enter your password to proceed. Now you can restart Terminal.app and check if the installation is correct:
echo $BASH_VERSION
Now you can define:
1
| |