delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/08/17:52:11

From: huott AT pinebush DOT com (Ed Huott)
Subject: Re: "which" command
8 Jan 1997 17:52:11 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199701082214.RAA13874.cygnus.gnu-win32@sol.pinebush.com>
Original-To: gnu-win32 AT cygnus DOT com
In-reply-to: Your message of "Wed, 08 Jan 1997 10:41:51 PST."
<32D3EA6F DOT 901 AT infoscape DOT com>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019