From 1d5afa4ccc54cb8b7dd8aa9cce8dbe729c6e6768 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Thu, 17 Mar 2016 21:31:45 +0100 Subject: [PATCH] [fix] posix compatibility --- manage.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/manage.sh b/manage.sh index bc5b73dfd..3e1f59429 100755 --- a/manage.sh +++ b/manage.sh @@ -71,7 +71,7 @@ locales() { } help() { - [ -z "$1" ] || echo -e "Error: $1\n" + [ -z "$1" ] || printf "Error: $1\n" echo "Searx manage.sh help Commands @@ -90,8 +90,6 @@ Commands " } -if [ -n "$(type -t $ACTION)" ] && [ "$(type -t $ACTION)" = function ]; then - $ACTION -else - help "action not found" -fi +[ "$(command -V "$ACTION" | grep ' function$')" != "" ] \ + && $ACTION \ + || help "action not found"