1If you want `which' to inform you about aliases and shell functions in bash,
2then you need to add the following five lines to your $HOME/.bash_profile:
3
4  function which ()
5  {
6      (alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-dot --show-tilde $@
7  }
8  export -f which
9
10This is the recommended use of this `which'.  Note that the rpm already adds
11this to /etc/profile.d; there is no need to add it to $HOME/.bash_profile if
12you installed the rpm.
13
14The C shell (csh, tcsh) doesn't have shell functions, but fortunately
15inherites aliases in subshells.  To support aliases with a C shell add
16the following line to your .profile:
17
18  alias which 'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
19