Blame SOURCES/which2.sh

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