From baf1778540068a33f61fb93e81046d5efcd5a520 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 6 Apr 2017 11:27:40 +0200 Subject: [PATCH] mute the error message using bash3, see #697 (2.8) --- testssl.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testssl.sh b/testssl.sh index 5e7ce59..8b9648f 100755 --- a/testssl.sh +++ b/testssl.sh @@ -518,13 +518,13 @@ strip_trailing_space() { echo "${1%"${1##*[![:space:]]}"}" } - -toupper() { echo -n "${1^^}" ; } -tolower() { echo -n "${1,,}" ; } -if ! toupper aaa 2>&1 >/dev/null; then - # older bash can't do this (MacOS X), even SLES 11, see #697 +if [[ "$BASH_VERSINFO" == 3 ]]; then + # older bash can do this only (MacOS X), even SLES 11, see #697 toupper() { tr 'a-z' 'A-Z' <<< "$1"; } tolower() { tr 'A-Z' 'a-z' <<< "$1"; } +else + toupper() { echo -n "${1^^}"; } + tolower() { echo -n "${1,,}"; } fi is_number() {