From 2de05069d2d8195d75790bb392e5825c34ed3f36 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Thu, 5 May 2022 14:54:29 +0200 Subject: mbuto: In prog_add(), look for executable path in output from which ...instead of just picking the output: on Fedora and RHEL 'which' itself is an alias, but its actual path will also be reported by 'which -a'. Reported-by: Cornelia Huck Signed-off-by: Stefano Brivio --- mbuto | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mbuto b/mbuto index abfad76..20427ad 100755 --- a/mbuto +++ b/mbuto @@ -780,7 +780,15 @@ prog_add() { IFS=',' for __a in ${1}; do - __bin="$(${WHICH} "${__a}")" && break + # We might have alias definitions too, look for a path + IFS=' +' + __bin= + for __path in $(${WHICH} -a "${__a}" 2>/dev/null); do + [ -x "${__path}" ] && __bin="${__path}" && break + done + [ -n "${__bin}" ] && break + IFS=',' done unset IFS [ -z "${__bin}" ] && err "Can't source ${1}" -- cgit v1.2.3