Old bash version on MacOS ?
What? An older bash version?
Are you seeing and still not believing on something like below,
MacBook-Pro:~$ bash --version GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16) Copyright (C) 2007 Free Software Foundation, Inc.
Well that is my MBP as of Mar 29, 2017 running MacOS Sierra Version 10.12.4 Beta (16E192b).
So here is what I did,
MacBook-Pro:~$ brew install bash
And later bash --version
reported 4.4.12(1) 😉
MacBook-Pro:~$ bash --version GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Well one more thing, if you haven’t figured that things aren’t working as expected!
Either,
- Add/ Change the shebang on the scripts toÂ
#!/usr/local/bin/bash
, OR - Modify line /bin/bash in file /etc/shells to /usr/local/bin/bash
Configure terminal to use it
# Add the new shell to the list of allowed shells sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' # Change to the new shell chsh -s /usr/local/bin/bash