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:
+9
-4
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user