2

I'm trying to update bash to version 4.x. I did brew upgrade, then brew update, then brew install bash. I ran sudo bash -c "echo /usr/local/bin/bash >> /etc/shells" and sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells". I've tried symlinking /usr/local/Cellar/bash/4.3.32/bin/bash to /usr/local/bin/bash. I've closed Terminal.app. I've even logged out of Mac completely. Nothing I do has updated $BASH_VERSION to the right thing. bash --version does say the right thing, but I think I read somewhere that that is less reliable then echo $BASH_VERSION (maybe). Here's a summary of what I'm seeing:

enter image description here

I just need to know . . . what version of bash am I actually on? And if it's not 4.x, how do I reliably, definitively make it that?

I am on Yosemite FWIW.

Edit:

$PATH was too long for a comment. Here it is:

/Users/AndrewNichols/.rvm/gems/ruby-2.1.1/bin:/Users/AndrewNichols/.rvm/gems/ruby-2.1.1@global/bin:/Users/AndrewNichols/.rvm/rubies/ruby-2.1.1/bin:/usr/local/heroku/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/Cellar/grep/2.18/bin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/heroku/bin:/usr/local/opt/coreutils/libexec/gnubin:/usr/local/Cellar/grep/2.18/bin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/opt/gnu-tar/libexec/gnubin:~/activator:/Users/AndrewNichols/sonarqube-4.5/bin/macosx-universal-64:/Users/AndrewNichols/sonar-runner-2.4/bin:/Users/AndrewNichols/bin:~/activator:/Users/AndrewNichols/sonarqube-4.5/bin/macosx-universal-64:/Users/AndrewNichols/sonar-runner-2.4/bin:/Users/AndrewNichols/bin:/Users/AndrewNichols/.rvm/bin

Here's one split on colon, for readability:

'/Users/AndrewNichols/.rvm/gems/ruby-2.1.1/bin',
'/Users/AndrewNichols/.rvm/gems/ruby-2.1.1@global/bin',
'/Users/AndrewNichols/.rvm/rubies/ruby-2.1.1/bin',
'/usr/local/heroku/bin',
'/usr/local/opt/coreutils/libexec/gnubin',
'/usr/local/Cellar/grep/2.18/bin',
'/usr/local/opt/gnu-sed/libexec/gnubin',
'/usr/local/opt/gnu-tar/libexec/gnubin',
'/usr/local/bin',
'/usr/bin',
'/bin',
'/usr/sbin',
'/sbin',
'/opt/X11/bin',
'/usr/local/heroku/bin',
'/usr/local/opt/coreutils/libexec/gnubin',
'/usr/local/Cellar/grep/2.18/bin',
'/usr/local/opt/gnu-sed/libexec/gnubin',
'/usr/local/opt/gnu-tar/libexec/gnubin',
'~/activator',
'/Users/AndrewNichols/sonarqube-4.5/bin/macosx-universal-64',
'/Users/AndrewNichols/sonar-runner-2.4/bin',
'/Users/AndrewNichols/bin',
'~/activator',
'/Users/AndrewNichols/sonarqube-4.5/bin/macosx-universal-64',
'/Users/AndrewNichols/sonar-runner-2.4/bin',
'/Users/AndrewNichols/bin',
'/Users/AndrewNichols/.rvm/bin'

Some of the duplication there is because I have terminal set to run tmux on startup, so .bashrc gets sourced twice.

  • Where and how did you change the login shell for your user account? – nohillside Jan 2 '16 at 22:20
  • chsh -s /usr/local/bin/bash. Basically as described here. – tandrewnichols Jan 2 '16 at 22:22
  • what is the output of echo $PATH? – njboot Jan 3 '16 at 3:54
  • @njboot - See my edits above. – tandrewnichols Jan 3 '16 at 14:38
3

Okay, so apparently this was happening because tmux was holding on to the original bash version (even though I had exited tmux and reloaded it's config). tmux kill-server followed by relaunching tmux fixed it for me.

-3

This should fix your issue.

mv /bin/bash /bin/bash3 

and then create a symlink to

ln -s /usr/local/bin/bash /bin/bash

That should fix your issue.

  • 2
    I'm not an expert, but that sounds like a really bad idea. Actually, I'm pretty sure this is impossible with SIP on 10.11 and later. – NReilingh Jan 3 '16 at 1:42
  • Well, I'm on Yosemite, so SIP isn't necessarily a problem. But it does sound dodgy either way. I felt weird enough moving /usr/local/bin/bash to /usr/local/bin/bash.bak so I could symlink the homebrew one. – tandrewnichols Jan 3 '16 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .