From 534c88c96a581259fd056eaae3a50fe87880d3f3 Mon Sep 17 00:00:00 2001 From: bol-van Date: Tue, 2 Dec 2025 08:53:38 +0300 Subject: [PATCH] fix 'which' function behavior with absolute paths --- common/base.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/base.sh b/common/base.sh index 84487ae8..ece185e6 100644 --- a/common/base.sh +++ b/common/base.sh @@ -4,6 +4,10 @@ which() # 'command -v' replacement does not work exactly the same way. it outputs shell aliases if present # $1 - executable name local IFS=: + [ "$1" != "${1#/}" ] && [ -x "$1" ] && { + echo "$1" + return 0 + } for p in $PATH; do [ -x "$p/$1" ] && { echo "$p/$1"