From: Ilya Shipitsin Date: Sat, 26 Sep 2020 06:54:27 +0000 (+0500) Subject: REGTESTS: use "command" instead of "which" for better POSIX compatibility X-Git-Tag: v2.3-dev6~141 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7faeea9750c204c9a24c4e111cd81ce0908ad2df;p=thirdparty%2Fhaproxy.git REGTESTS: use "command" instead of "which" for better POSIX compatibility for example, "which" is not installed by default in Fedora docker image. --- diff --git a/scripts/run-regtests.sh b/scripts/run-regtests.sh index af25a60753..7bcc394cfc 100755 --- a/scripts/run-regtests.sh +++ b/scripts/run-regtests.sh @@ -191,8 +191,8 @@ _findtests() { done for requiredbin in $require_binaries; do - which $requiredbin >/dev/null 2>&1 - if [ "$?" -eq "1" ]; then + if ! command -v $requiredbin >/dev/null 2>&1 + then echo " Skip $i because '"$requiredbin"' is not installed" skiptest=1 fi