_which () { local file=$(type -p ${1+"$@"} 2>/dev/null) if test -n "$file" -a -x "$file"; then echo "$file" return 0 fi hash -r type -P ${1+"$@"} }