Mail Archives: cygwin/1997/01/08/17:52:11
In message <32D3EA6F DOT 901 AT infoscape DOT com>, 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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -