diff options
author | Fam Zheng <famz@redhat.com> | 2014-11-19 15:07:12 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-12-10 10:31:12 +0100 |
commit | e465ce7d09939d631f1861e0bd8873417c1c0d65 (patch) | |
tree | edf9463524944ddf518d0255f55b4690f8d855f0 /tests/qemu-iotests/common | |
parent | 4c58e80acd61e24f307c1b2557079cc77dc9150a (diff) |
tests: Use "command -v" instead of which(1) in shell scripts
When which(1) is not installed, we would complain "perl not found"
because it's the first set_prog_path check. The error message is
wrong.
Fix it by using "command -v", a native way to query the existence of a
command.
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1416380832-9697-1-git-send-email-famz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common')
-rw-r--r-- | tests/qemu-iotests/common | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 9e12bec2bf..bc27f6a073 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -289,10 +289,10 @@ testlist options if [ ! -z "$DISPLAY" ] then - which xdiff >/dev/null 2>&1 && diff=xdiff - which gdiff >/dev/null 2>&1 && diff=gdiff - which tkdiff >/dev/null 2>&1 && diff=tkdiff - which xxdiff >/dev/null 2>&1 && diff=xxdiff + command -v xdiff >/dev/null 2>&1 && diff=xdiff + command -v gdiff >/dev/null 2>&1 && diff=gdiff + command -v tkdiff >/dev/null 2>&1 && diff=tkdiff + command -v xxdiff >/dev/null 2>&1 && diff=xxdiff fi ;; |