From ff9389d98cc3037ccd4dad156744346d55dbd2de Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Wed, 15 Sep 2021 11:35:52 +0200 Subject: [PATCH] roachtest: require bash v4+ for roachstress.sh The bash bundled with OSX doesn't even support `read -i` so we're better off encouraging folks to use a version that isn't over a decade old. Release note: None --- pkg/cmd/roachtest/roachstress.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cmd/roachtest/roachstress.sh b/pkg/cmd/roachtest/roachstress.sh index f113ce9a297b..1fd79be4d6d4 100755 --- a/pkg/cmd/roachtest/roachstress.sh +++ b/pkg/cmd/roachtest/roachstress.sh @@ -10,6 +10,11 @@ set -euo pipefail # It's best practice to invoke this script with "caffeinate" on OSX and/or linux # to avoid computer going to standby. +if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ]; then + echo "This script requires Bash version >= 4" + echo "On OSX, 'brew install bash' should do the trick." + exit 1 +fi # Read user input. if [ ! -v TEST ]; then read -r -e -p "Test regexp: " TEST; fi