Philosophical 'which' Guru question

Bob Kinney bc98kinney at yahoo.com
Tue Mar 31 04:06:58 UTC 2009


The default installation creates the alias:
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

OK, so if you issue the 'which' command, it pipes the output of 'alias'
into /usr/bin/which, which would be a list of aliases as arguments to the
/usr/bin/which command, right?  

I am assuming that the argument to the 'which' command would be appended
to the back end of the pipe, so 'which man' would expand to 
'alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde man'

The rest of the default aliases are pretty much useful variations of 'ls',
but what is the point of this?

If I make an alias like 'foo=<print all of the man pages>' then wouldn't 
this kind of wipe out the value of the which command?

It would seem from my rookie view that the intent of this alias is to include `pwd` in the 'which' search. 

Why do they include every alias definition as input to /usr/bin/which?






      




More information about the fedora-list mailing list