Contents of the WHICH.DOC file
WHICH(1) USER COMMANDS WHICH(1)
which - locate commands
which command [ command ... ]
command Command or list of commands to locate.
which checks, in order, a list of internal command-shell
commands, the current directory, and directories specified
in the user's PATH variable for the commands given as its
arguments. If a given command is found, its full path is
printed; otherwise a ``not found'' message is printed with a
list of the directories which were checked. In the case the
command is an internal shell command, a message to this
effect is printed in lieu of a path.
which respects the shell precedence of command extensions;
thus more.com is listed instead of more.exe, should both
exist in the same directory. Likewise, .exe files have pre-
cedence over .cmd files, and .cmd files over .bat files. A
command with a dot in its name has precedence over any
default extension; for example, list.old is found before
The following command lists the locations of four commands:
which dir format unzip zipinfo
dir: OS/2 command-shell internal command
no zipinfo in . c:\os2 c:\utils\32 c:\utils\16 c:\utils\bnd
c:\os2\system c:\emx\bin c:\groff\bin c:\os2\mdos\winos2
c:\os2\install c:\ c:\os2\mdos c:\os2\apps c:\ibmtk\os2bin
The list of internal shell commands is static and does not
reflect differences between various versions, including
third-party shells such as 4OS2 (or 4DOS).
Greg Roelofs (also known as Cave Newt). The makefile was
liberally borrowed from Kai Uwe Rommel's UnZip makefile.
Newtware Last change: 12 Mar 93 (v1.0) 1