From fb23d474b330fac4704b9baa7cfa98745ab1015b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 12 Mar 2023 17:57:03 -0700 Subject: [PATCH] Fix the test for the Bash version for shellcheck (#142) * Fix the test for the Bash version for shellcheck * Add parenthesis and whitespace for clarity --------- Co-authored-by: Michael Diamond --- bash-preexec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-preexec.sh b/bash-preexec.sh index bc98976..6f26569 100644 --- a/bash-preexec.sh +++ b/bash-preexec.sh @@ -43,7 +43,7 @@ fi # We only support Bash 3.1+. # Note: BASH_VERSINFO is first available in Bash-2.0. -if [[ -z "${BASH_VERSINFO-}" || BASH_VERSINFO[0] -lt 3 || BASH_VERSINFO[0] -eq 3 && BASH_VERSINFO[1] -lt 1 ]]; then +if [[ -z "${BASH_VERSINFO-}" ]] || (( BASH_VERSINFO[0] < 3 || (BASH_VERSINFO[0] == 3 && BASH_VERSINFO[1] < 1) )); then return 1 fi