Blame SOURCES/which2.sh

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