How do I update or upgrade bash version?

Homebrew user can type the following brew command to install the lastst version of bash on Catalina:

brew install bash

The newer version of bash is located at /usr/local/bin/bash:

ls -l /usr/local/bin/bashcat /etc/shells

If not in /etc/shells, append it:

sudo -iecho /usr/local/bin/bash >> /etc/shells

Set default shell to /usr/local/bin/bash, run the following chsh command

chsh -s /usr/local/bin/bash

Verify new version:

bash --version

/usr/local/bin/bash --version

Sample outputs:

GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin18.6.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.