4
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/bash
to/etc/shells
and 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?
What says which bash? – Mirko Ebert – 2014-11-05T22:39:58.540
Looks like: http://superuser.com/questions/484924/bash-upgrade-on-mac-osx?rq=1 or http://superuser.com/questions/570433/upgrading-postgresql-via-homebrew?rq=1
– Mirko Ebert – 2014-11-05T22:46:05.483@tfb785
which bash
gives/usr/local/bin/bash
. – Gregory Higley – 2014-11-05T22:55:56.520@tfb785 Also,
/etc/paths
has/usr/local/bin
before/usr/bin
, so that doesn't appear to be the issue. – Gregory Higley – 2014-11-05T22:56:28.743