Upgrade to bash 4 in macOS

I know. Sorry for the long delay in updates. Been extremely busy with my job developing mobile apps and other stuff.

I came here just for write a notes about install Bash 4 to get some interesting feature from this Shell.


First we are going to get your current Bash version installed. If you have 4.X, skip this guide and enjoy your life :)


bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)
Copyright (C) 2007 Free Software Foundation, Inc.

We are going to use the great Homebrew package manager:


/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install bash
bash --version

Last step is to get it as the default Shell in your system:


sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
chsh -s /usr/local/bin/bash

Link: admon.org > New Features in Bash-4.0


We request your permission to obtain statistical data on its navigation on this website. If you continue to browse we consider to accept the use of cookies. OK | More Information
{"cc_re__cc_re__cc_by_sa_4_0": ["              \n\t\t\t            </div>\n\t\t\t        </div>\n\t\t        </aside>\n\t\t    </div>\n\t\t</div>\n\t\t<div id=\"barraaceptacion\" style=\"display: block;\">\n\t\t\t<div class=\"inner\">We request your permission to obtain statistical data on its navigation on this website. If you continue to browse we consider to accept the use of cookies. <a href='#' class='ok' onclick='controlcookies();'><b>OK</b></a> | <a href='cookies.php' class='info'>More Information</a></div>\n\t\t</div>\n\t\t<footer id=\"footer\">\n\t\t      <p><a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/4.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-sa/4.0/88x31.png\" /></a> This work is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/4.0/\">Creative Commons Attribution-ShareAlike 4.0 International License.</a>. <br />  Jose Manuel Cerrejon Glez (<a href='http://twitter.com/ulysess10' target=_blank>@ulysess10</a>) | Developed from scratch! | Counter:  <a title=\"web counter\" href=\"http://statcounter.com/\" target=", "on its navigation on this website. If you continue to browse we consider to accept the use of cookies. <a href='#' class='ok' onclick='controlcookies();'><b>OK</b></a> | <a href='cookies.php' class='info'>More Information</a></div>\n\t\t</div>\n\t\t<footer id=\"footer\">\n\t\t      <p><a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/4.0/\"><img alt=\"Creative Commons License\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-sa/4.0/88x31.png\" /></a> This work is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-sa/4.0/\">Creative Commons Attribution-ShareAlike 4.0 International License.</a>. <br />  Jose Manuel Cerrejon Glez (<a href='http://twitter.com/ulysess10' target=_blank>@ulysess10</a>) | Developed from scratch! | Counter:  <a title=\"web counter\" href=\"http://statcounter.com/\" target=\"_blank\"><img class=\"statcounter\" src=\"http://c.statcounter.com/8614610/0/0aaf4ae6/0/\" alt=\"web counter\" /></a></p>\n\t\t      <p>This blog use cookies to improve the user experience. More info <a href='cookies.php'>here</a></p>"], "copyright__copyright__copyright": ["sr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\nbrew install bash\nbash --version\n\nLast step is to get it as the default Shell in your system:\n\n\nsudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'\nchsh -s /usr/local/bin/bash\n\nLink: admon.org > New Features in Bash-4.0\n\n\nWe request your permission to obtain statistical data on its navigation on this website. If you continue to browse we consider to accept the use of cookies. OK | More Information"]}