Use command -v rather than hash to detect commands (command is Posix and works

on OpenBSD).
This commit is contained in:
David Given 2016-11-26 12:53:36 +01:00
parent a596973f28
commit 2dc083f436

View file

@ -15,7 +15,7 @@ trap "rm -f $pidfile" EXIT
case $method in case $method in
qemu-system-*) qemu-system-*)
if ! hash $method 2>/dev/null; then if ! command -v $method 2>/dev/null; then
echo "Warning: $method not installed, skipping test" echo "Warning: $method not installed, skipping test"
exit 0 exit 0
fi fi
@ -33,7 +33,7 @@ case $method in
;; ;;
qemu-*) qemu-*)
if ! hash $method 2>/dev/null; then if ! command -v $method 2>/dev/null; then
echo "Warning: $method not installed, skipping test" echo "Warning: $method not installed, skipping test"
exit 0 exit 0
fi fi
@ -48,4 +48,4 @@ case $method in
esac esac
( grep -q @@FAIL $result || ! grep -q @@FINISHED $result ) && cat $result && exit 1 ( grep -q @@FAIL $result || ! grep -q @@FINISHED $result ) && cat $result && exit 1
exit 0 exit 0