"Fossies" - the Fresh Open Source Software Archive

Member "which-2.21/README.alias" (8 Jan 2008, 755 Bytes) of package /linux/privat/which-2.21.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

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