which/which2.sh

14 lines
379 B
Bash
Raw Normal View History

2021-03-23 19:15:21 +00:00
# shellcheck shell=sh
# Initialization script for bash, sh, mksh and ksh
2021-12-02 14:53:11 +00:00
case "$(basename $(readlink /proc/$$/exe))" in
2022-11-07 15:37:08 +00:00
*ksh*|zsh)
alias which='alias | /usr/bin/which --tty-only --read-alias --show-tilde --show-dot'
;;
2021-12-02 14:53:11 +00:00
bash|sh)
2022-11-07 15:37:08 +00:00
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
;;
2021-12-02 14:53:11 +00:00
*)
;;
esac