I'm running OS X Yosemite. I need to use associative arrays in bash so I decided to use Homebrew to upgrade bash to 4.x. I performed the following steps:
brew install bash- I then added
/usr/local/bin/bashto/etc/shellsand rebooted for good measure. chsh -s /usr/local/bin/bash- For good measure, I logged out and logged back in, though a simple Terminal restart would probably have sufficed.
When I open Terminal, things seem to be fine. If I say $SHELL --version I get GNU bash, version 4.3.30(1)-release (x86_64-apple-darwin14.0.0). Unfortunately, if I say echo $BASH_VERSION I get 3.2.53(1)-release. Also, I can't seem to use any of the advanced features of Bash 4.x, like associative arrays, e.g., declare -A foo says -bash: declare: -A: invalid option.
Interestingly, echo $0 says -bash.
What's going on here? How do I get my associative arrays?