@@ -1,18 +1,19 @@
# shellcheck shell=sh
# Initialization script for bash, sh, mksh and ksh
-_declare="declare -f"
-_opt="-f"
-_shell="$(basename $SHELL)"
+which_declare="declare -f"
+which_opt="-f"
+which_shell="$(cat /proc/$$/comm)"
-if [ "$_shell" = "ksh" ] || [ "$_shell" = "mksh" ] || [ "$_shell" =
"zsh" ] ; then
- _declare="typeset -f"
- _opt=""
+if [ "$which_shell" = "ksh" ] || [ "$which_shell" = "mksh" ] || [
"$which_shell" = "zsh" ] ; then
+ which_declare="typeset -f"
+ which_opt=""
fi
which ()
{
-(alias; eval ${_declare}) | /usr/bin/which --tty-only --read-alias
--read-functions --show-tilde --show-dot "$@"
+(alias; eval ${which_declare}) | /usr/bin/which --tty-only --read-alias
--read-functions --show-tilde --show-dot "$@"
}