From fb979bd36c7e84dcd54bebe2277f58e6a6281ede Mon Sep 17 00:00:00 2001 From: Paul Johnson Date: Fri, 29 Dec 2023 11:01:01 +0100 Subject: [PATCH] Check bash version MacOS ships an ancient bash version. --- utils/dc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/dc b/utils/dc index 908a0370..a84352ee 100755 --- a/utils/dc +++ b/utils/dc @@ -7,7 +7,13 @@ # The latest version of this software should be available from my homepage: # http://www.pjcj.net -set -euo pipefail +if ((BASH_VERSINFO[0] < 5)); then + echo "❌ bash version $BASH_VERSION is too old. Please install v5 or higher." + exit 1 +fi + +set -eEuo pipefail +shopt -s inherit_errexit script=$(basename "$0") readl=readlink