2021-03-18 17:00:58 +00:00
|
|
|
# Initialization script for bash, sh, mksh and ksh
|
2021-03-21 13:17:16 +00:00
|
|
|
|
|
|
|
_declare="declare -f"
|
|
|
|
_opt="-f"
|
2021-03-23 18:57:58 +00:00
|
|
|
_shell="$(basename $SHELL)"
|
2021-03-21 13:17:16 +00:00
|
|
|
|
2021-03-23 18:57:58 +00:00
|
|
|
if [ "$_shell" = "ksh" ] || [ "$_shell" = "mksh" ] || [ "$_shell" = "zsh" ] ; then
|
2021-03-21 13:17:16 +00:00
|
|
|
_declare="typeset -f"
|
|
|
|
_opt=""
|
|
|
|
fi
|
|
|
|
|
2021-03-18 17:00:58 +00:00
|
|
|
which ()
|
|
|
|
{
|
2021-03-21 13:17:16 +00:00
|
|
|
(alias; eval ${_declare}) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot "$@"
|
2021-03-18 17:00:58 +00:00
|
|
|
}
|
2021-03-21 13:17:16 +00:00
|
|
|
|
|
|
|
export ${_opt} which
|