From 2acccc101ee3aca3bb9e811b18812880731df180 Mon Sep 17 00:00:00 2001 From: Michael Davies Date: Mon, 28 Aug 2017 20:22:16 +0930 Subject: [PATCH] Fix os-cmd cross-distro compatibility The os-cmd script tests for available commands in a non-portable cross-platform way. This fix replaces it with something much more portable. Change-Id: I65e76f7991d03ae2234030ab1e3fb02865b81c32 Closes-Bug: #1713460 --- scripts/os-cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/os-cmd b/scripts/os-cmd index f3846cf903..455e64aebd 100755 --- a/scripts/os-cmd +++ b/scripts/os-cmd @@ -21,7 +21,7 @@ __check_cmd_avail () { - if [ "z$(which $1)" == "z" ]; then + if hash ${1} &> /dev/null; then echo "The command '$1' could not be found, exiting" exit 1 fi