From: David Given Date: Sat, 26 Nov 2016 11:53:36 +0000 (+0100) Subject: Use command -v rather than hash to detect commands (command is Posix and works X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2dc083f436cf611f743440982cd45c3080868ba5;p=ack.git Use command -v rather than hash to detect commands (command is Posix and works on OpenBSD). --- diff --git a/tests/plat/testdriver.sh b/tests/plat/testdriver.sh index f5ca187a3..1c57ee163 100755 --- a/tests/plat/testdriver.sh +++ b/tests/plat/testdriver.sh @@ -15,7 +15,7 @@ trap "rm -f $pidfile" EXIT case $method in qemu-system-*) - if ! hash $method 2>/dev/null; then + if ! command -v $method 2>/dev/null; then echo "Warning: $method not installed, skipping test" exit 0 fi @@ -33,7 +33,7 @@ case $method in ;; qemu-*) - if ! hash $method 2>/dev/null; then + if ! command -v $method 2>/dev/null; then echo "Warning: $method not installed, skipping test" exit 0 fi @@ -48,4 +48,4 @@ case $method in esac ( grep -q @@FAIL $result || ! grep -q @@FINISHED $result ) && cat $result && exit 1 -exit 0 \ No newline at end of file +exit 0