From ed0563b77081a339eba2f821e6bb4746fa42629f Mon Sep 17 00:00:00 2001 From: levasseur Date: Fri, 17 Dec 2021 16:43:55 +0100 Subject: [PATCH] utils.sh: fixed function_exists not to display grep result --- lib/utils.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index 0c0c4cf..95dbfa2 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -26,8 +26,11 @@ function_exists() { die 11 --force fi - LC_ALL=C type -t $1 | grep function - return $? + if [[ $(LC_ALL=C type -t $1 | grep function) ]]; then + return 0 + else + return 1 + fi } export -f function_exists