MPE/iX Shell and Utilities Reference Manual, Vol 2
which(1) MPE/iX Shell and Utilities which(1)
NAME
which — display path name for executable command
SYNOPSIS
which [–a] command ...
DESCRIPTION
The MPE/iX Shell sh(1) uses the
PATH
environment variable to determine which directories
are searched to find programs. For each command, which looks through the directories in the
PATH
variable, and displays the path name of the first executable file that matches command.
Options
which accepts the following option:
–a displays all matching executable files from every directory in
PATH
, not just the first
match. This can help you find conflicts between two executables of the same name.
ENVIRONMENT VARIABLES
which uses the following environment variable:
PATH
contains a list of directories for which to search when looking for command.
DIAGNOSTICS
Possible exit status values are:
0 An appropriate executable file can be found with the current
PATH
.
1 Failure due to any of the following:
— an appropriate executable file cannot be found
— invalid command line option
Message
Because this utility is built into the
MPE/iX Shell, see the sh(1) man page for a complete list of
error messages that you may receive when using it.
PORTABILITY
Available on some UNIX systems.
NOTE
This command does not know about shell keywords, aliases, functions, etc. For this reason,
whence(1) is recommended when you are seeking information about a shell-related utility.
MPE/iX NOTES
For information on how the current MPE/iX implementation may affect the operation of this
utility, see Appendix A, MPE/iX Implementation Considerations.
1-698 Commands and Utilities