diff --git a/data/etc/profile b/data/etc/profile index 4ea4aa8385..2452a1f0bf 100644 --- a/data/etc/profile +++ b/data/etc/profile @@ -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'