I don't know, if that makes is less almost-ksh compatible, but whence

(aka which) now returns 1 when it cannot find a specified command.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25169 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-04-26 00:50:21 +00:00
parent f8a2f7ce58
commit 425b1199b0
+9 -4
View File
@@ -60,6 +60,8 @@ whence()
return 1
fi
returnValue=0
for cmd
do
if [ "$vflag" ] ; then
@@ -70,12 +72,15 @@ whence()
echo $path
else
case "$cmd" in
/*) if [ -x "$cmd" ]; then
echo "$cmd"
*/*) if [ -x "$cmd" ]; then
echo "$cmd"
else
returnValue=1
fi
;;
*) case "$(builtin type -type $cmd)" in
"") ;;
"") returnValue=1
;;
*) echo "$cmd"
;;
esac
@@ -84,7 +89,7 @@ whence()
fi
fi
done
return 0
return $returnValue
}
alias which='whence'