Blame SOURCES/which2.sh

79d63a
# shellcheck shell=sh
79d63a
# Initialization script for bash, sh, mksh and ksh
79d63a
1d4f52
case "$(basename $(readlink /proc/$$/exe))" in
1d4f52
*ksh*)
1d4f52
    which_declare=""
1d4f52
    which_opt=""
1d4f52
    ;;
1d4f52
zsh)
1d4f52
    which_declare="typeset -f"
1d4f52
    which_opt=""
1d4f52
    ;;
1d4f52
bash|sh)
1d4f52
    which_declare="declare -f"
1d4f52
    which_opt="-f"
1d4f52
    ;;
1d4f52
*)
1d4f52
    which_declare=""
1d4f52
    which_opt=""
1d4f52
    ;;
1d4f52
esac
79d63a
1d4f52
function which {
1d4f52
    (alias; eval ${which_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot $@
79d63a
}
79d63a
79d63a
export which_declare
79d63a
export ${which_opt} which