On Wed, 20 Jun 2001, Aaron Lawson wrote:

> I think it depends on the version of BASH one is using.  'which'  works in 
> my version of BASH, but neither 'whereis' nor 'where' works.  I'm using GNU 
> bash, version 2.05.0(1).

But what does `which which` return and more importantly: 

   file `which which`

if it is a text file then:

   head `which which`

may tell you that it is a csh (or tcsh) script.  If you are running tcsh
as your shell then which is builtin to the shell.  AIX ships with a
/usr/bin/which script that looks like so:

 $ echo $SHELL
 /bin/ksh
 $ which which
 /usr/bin/which
 $ head `which which`
 #!/usr/bin/csh -f
 set prompt = "% "
 if ( -f ~/.cshrc) then
         source ~/.cshrc
 endif
 if ( $#argv == 0 ) then
         dspmsg which.cat 3 'usage: which command...\n'
         exit 1
 endif
 set noglob

By the way some POSIX compliant shells have a built in command "whence"
while another unix vendor (HP?) used "what" as an equivalent utility.
I doubt these would be useful on OS X but it sometimes pays to know the
difference and how to tell.

Peter Prymmer


Reply via email to