Merge pull request #109 from mcpcpc/master

checkUtils: remove non-POSIX compliant features
This commit is contained in:
Lukáš Mešťan 2020-07-22 17:18:59 +02:00 committed by GitHub
commit 3283122a38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,14 +74,14 @@ _theme="${_MENU_THEME:=default}"
# ARGS: None
# OUTS: None
################################################################################
function checkUtils() {
local -r msg="not found. Please make sure this is installed and in PATH."
declare -ar utils=("awk" "basename" "cat" "column" "echo" "git" "grep" "head"
"seq" "sort" "tput" "tr" "uniq" "wc")
checkUtils() {
readonly MSG="not found. Please make sure this is installed and in PATH."
readonly UTILS="awk basename cat column echo git grep head seq sort tput \
tr uniq wc"
for u in "${utils[@]}"
for u in $UTILS
do
command -v "$u" >/dev/null 2>&1 || { echo >&2 "$u ${msg}"; exit 1; }
command -v "$u" >/dev/null 2>&1 || { echo >&2 "$u ${MSG}"; exit 1; }
done
}