This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Cygwin "which" and aliases


Bob,

It works fine:

% which which
which ()
/usr/bin/which
%

So I know there is both a binary (or a script) and a shell function. Very 
nice, actually.

Are you using BASH? I don't think it would work in a CSH-compatible shell.

Randall Schulz
Mountain View, CA USA


At 13:55 2001-10-12, RCUNNINGHAM@redlake.com wrote:
>I wanted to make my "which" command also show aliases, so I tried the 
>pretty macro from the which man page.  It didn't work.
>
>I decided I also wanted to list functions, so I needed a better approach. 
>Here's my attempt at a bash function for which:
>
>which ()
>{
>     builtin alias $* 2>|/dev/null;
>     set | grep ^$*;
>     /usr/bin/which $* 2>|/dev/null | grep -v ^no
>}
>
>
>Try entering "which which".
>
>Anyone know of an improved approach?
>
>
>Regards,
>
>-BobC


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]