$BASH_VERSION reports old version of bash on macOS, is this a problem that should be fixed?

It means that the shell you’re in is Bash 3.2, but bash points to Bash 5.0. Try bash and then, in the new shell, echo $BASH_VERSION – I guess it’ll be 5.0. To change your login shell, add /usr/local/bin/bash to /etc/shells and change the default shell with

chsh -s /usr/local/bin/bash
sudo chsh -s /usr/local/bin/bash

After logging out and in again, $BASH_VERSION should be updated.

As for shebang lines, I recommend

#!/usr/bin/env bash

as it’s portable and will use the first Bash in your $PATH.

Leave a Comment