Changeset 25169

Show
Ignore:
Timestamp:
04/25/08 19:50:21 (3 weeks ago)
Author:
bonefish
Message:
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.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/data/etc/profile

    r24112 r25169  
    6161        fi 
    6262 
     63        returnValue=0 
     64 
    6365        for cmd 
    6466        do 
     
    7173                        else 
    7274                                case "$cmd" in 
    73                                         /*) if [ -x "$cmd" ]; then 
    74                                                 echo "$cmd" 
     75                                        */*) if [ -x "$cmd" ]; then 
     76                                                        echo "$cmd" 
     77                                                else 
     78                                                        returnValue=1 
    7579                                            fi 
    7680                                            ;; 
    7781                                         *) case "$(builtin type -type $cmd)" in 
    78                                                 "") ;; 
     82                                                "") returnValue=1 
     83                                                        ;; 
    7984                                                 *) echo "$cmd" 
    8085                                                    ;; 
     
    8590                fi 
    8691        done 
    87         return 0 
     92        return $returnValue 
    8893} 
    8994