From 5337160b7a467325c99700b97ee35cc630c33e1d Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 9 Jun 2022 14:21:15 +0200 Subject: [PATCH] modbuild: test for bash 5 or later, otherwise abort --- Pmodules/modbuild.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Pmodules/modbuild.in b/Pmodules/modbuild.in index cef62a7..9b85ddd 100755 --- a/Pmodules/modbuild.in +++ b/Pmodules/modbuild.in @@ -34,6 +34,14 @@ source libstd.bash || { echo "Oops: cannot source library -- '$_'" 1>&2; exit 3; } +if (( ${BASH_VERSINFO[0]} < 5 )); then + std::info "bash >= 5 is required! You are running bash ${BASH_VERSION} ..." + std::info "Make sure that bash >= 5 is in your PATH." + std::info "bash >= 5 is available as Pmodule:" + std::info " module load System:bash" + std::die 3 "" +fi + std::def_cmds "${path}" \ 'awk' 'base64' 'find' 'getopt' 'logger' 'mktemp' \ 'rm' 'sort' 'find' 'yq'