2 # An almost-ksh compatible `whence' command. This is as hairy as it is
3 # because of the desire to exactly mimic ksh.
5 # This depends somewhat on knowing the format of the output of the bash
6 # `builtin type' command.
15 if [ "$#" = "0" ] ; then
16 echo "whence: argument expected"
23 -*) echo "whence: bad option: $1"
29 if [ "$#" = "0" ] ; then
30 echo "whence: bad argument count"
36 if [ "$vflag" ] ; then
37 echo $(builtin type $cmd | sed 1q)
39 path=$(builtin type -path $cmd)
44 /*) if [ -x "$cmd" ]; then
48 *) case "$(builtin type -type $cmd)" in