Due to GPL limitations, OSX ships with bash v3.2.57. As of writing this the current version is bash v5.0.2. bash v4 and beyond support unicode characters, and much more.
Check current bash version with:
echo $BASH_VERSION
To upgrade use Homebrew
brew install bash
Add new bash to list of approved shells:
sudo nano /etc/shells
Add this line to the top of the list:
/usr/local/bin/bash
Change the shell to use the new version:
chsh -s /usr/local/bin/bash
Change bash scripts from using this at the top:
#!/bin/bash
To use the newest version:
#!/usr/bin/env bash
Open a new terminal window and test you're using the latest version:
echo $BASH_VERSION
For more information, see also: Upgrade to bash 4 in Mac OS X