2021-11-09 10:03:32 +00:00
|
|
|
# shellcheck shell=sh
|
|
|
|
# Initialization script for bash, sh, mksh and ksh
|
2019-05-07 11:23:34 +00:00
|
|
|
|
2021-11-09 10:03:32 +00:00
|
|
|
which_declare="declare -f"
|
|
|
|
which_opt="-f"
|
|
|
|
which_shell="$(cat /proc/$$/comm)"
|
|
|
|
|
|
|
|
if [ "$which_shell" = "ksh" ] || [ "$which_shell" = "mksh" ] || [ "$which_shell" = "zsh" ] ; then
|
|
|
|
which_declare="typeset -f"
|
|
|
|
which_opt=""
|
2019-05-07 11:23:34 +00:00
|
|
|
fi
|
2021-11-09 10:03:32 +00:00
|
|
|
|
|
|
|
which ()
|
|
|
|
{
|
|
|
|
(alias; eval ${which_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
export which_declare
|
|
|
|
export ${which_opt} which
|