Subject: Re: "which" command
From: [email-masked] (Ed Huott)

8 Jan 1997 17:52:11 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Original-To: [email-masked]
In-reply-to: Your message of "Wed, 08 Jan 1997 10:41:51 PST."
             <[email-masked]> 
Original-Sender: [email-masked]

In message <[email-masked]>, Justin Gordon writes:
>is there an implementation of "which"
>
>or is there a way to make find only search in the path?
>
There is a built-in command in the bash shell called `type' that will
perform the equivalent of `which'.  Here is an excerpt from the bash
info file that describes it:

  `type'
	    type [-all] [-type | -path] [NAME ...]
       For each NAME, indicate how it would be interpreted if used as a
       command name.

       If the `-type' flag is used, `type' returns a single word which is
       one of "alias", "function", "builtin", "file" or "keyword", if
       NAME is an alias, shell function, shell builtin, disk file, or
       shell reserved word, respectively.

       If the `-path' flag is used, `type' either returns the name of the
       disk file that would be executed, or nothing if `-type' would not
       return "file".

       If the `-all' flag is used, returns all of the places that contain
       an executable named FILE.  This includes aliases and functions, if
       and only if the `-path' flag is not also used.

       `Type' accepts `-a', `-t', and `-p' as equivalent to `-all',
       `-type', and `-path', respectively.

There is also a native NT version of `which' called NTWHICH.EXE which is
probably downloadable from any of the popular shareware sites.  It's
freeware (GPL) authored by Jack J. Woehr.

<ED>
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".