SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Sponsored Links

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

If you want `which' to inform you about aliases and shell functions in bash, then you need to add the following five lines to your $HOME/.bash_profile:

which ()
{

(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-dot --show-tilde' }
export -f which

This is the recommended use of this `which'. Note that the rpm already adds this to /etc/profile.d; there is no need to add it to $HOME/.bash_profile if you installed the rpm.

The C shell (csh, tcsh) doesn't have shell functions, but fortunately inherites aliases in subshells. To support aliases with a C shell add the following line to your .profile:

alias which 'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'


Sponsored Links

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.