All pastes #238327 Raw Edit

Mine

public text v1 · immutable
·published 2006-11-04 23:02 UTC
rendered paste body
            _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+"$@"}
            }