Commit 534c88c9 authored by bol-van's avatar bol-van
Browse files

fix 'which' function behavior with absolute paths

parent 7be97908
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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"