Use command -v rather than hash to detect commands (command is Posix and works
authorDavid Given <dg@cowlark.com>
Sat, 26 Nov 2016 11:53:36 +0000 (12:53 +0100)
committerDavid Given <dg@cowlark.com>
Sat, 26 Nov 2016 11:53:36 +0000 (12:53 +0100)
on OpenBSD).

tests/plat/testdriver.sh

index f5ca187..1c57ee1 100755 (executable)
@@ -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