.\" $HeadURL$ $LastChangedRevision$ .\" .TH WHICH 1 "SPPSYM_RELEASE_DATE_MAN" .ne 5 .SH NAME which \- locate a command .br .ne 5 .SH SYNOPSIS .B which [ .B \-V | .B \-\-version ] [ .B \-v | .B \-\-verbose | .B \-d .I level | .B \-\-debug=\fIlevel ] [ .B \-h | .B \-\-help ] [ .B \-p | .B \-\-list\-paths ] [ .B \-P .I path | .B \-\-path=\fIpath ] [ .B \-a | .B \-\-all ] [ .B \-r .I range | .B \-\-range=\fIrange ] [ .B \-\-say ] [ .I command | .I text ] ... .br .ne 5 .SH DESCRIPTION This manual page documents version SPPSYM_RELEASE_ID of .B which\fR. .PP .B Which displays the full pathname of the command that would be executed for the specified commands. Its major advantage over the standard .B which\fR(1) command is that it does not consult the settings made in .B .cshrc (see .B csh\fR(1)). .ne 5 .SH CONFIGURATION None. .br .ne 5 .SH OPTIONS .TP 25 .B \-a\fR, \fB\-\-all When several instances of .I command appear in the searched path, it is the first that would be executed, and which .B which displays by default. This option facilitates display of all matching instances. .TP .B \-d \fIlevel\fR, \fB\-\-debug=\fIlevel\fR Determines how verbose .B which will be. The message types displayed for the different values of .I level are as follows: .RS 25 .TP 5 .B 0 internal errors only .TP .B 1 internal errors and normal errors .TP .B 2 internal errors, normal errors and warnings .TP .B 3 internal errors, normal errors, warnings and informational messages .TP .B >3 all the above plus application-specific debug messages. .RE .TP 25 .B \-h\fR, \fB\-\-help Displays a brief usage message. .TP .B \-p\fR, \fB\-\-list\-paths List the compiled-in paths of various files and directories that .B which uses. .TP .B \-P\fR, \fB\-\-paths=\fIpath Search for .I command in the directories specified by .I path instead of those specified by .B $PATH\fR. .TP .B \-r\fR, \fB\-\-range=\fIrange When several instances of .I command appear in the searched path, it is the first that would be executed, and which .B which displays by default. This option facilitates examination of the other instances which were found. .I range is a range specifier as per .B cut\fR(1), e.g. '2-4', '2-'. .TP .B \-\-say This makes .B which behave just like .B echo\fR(1). It is intended for scripts to determine if they are invoking this implementation of .B which\fR. .TP .B \-v\fR, \fB\-\-verbose Equivalent to .B \-d 3\fR. .TP .B \-V\fR, \fB\-\-version Print the program's version number and exit. .br .ne 5 .SH EXIT STATUS On success .B which returns zero. On failure it returns non-zero and displays a diagnostic message. .br .ne 5 .SH FILES None. .br .ne 5 .SH ENVIRONMENT VARIABLES .TP 25 .B PATH This is the default path searched. It may be overridden with the .B \-P option. .br .ne 5 .SH EXAMPLES The following command would determine which 'ls' would be executed when running .B ls\fR: .IP .nf .fam C .B which ls /bin/ls .fam T .fi .PP The following command would determine the location of all 'ls' commands: .IP .nf .fam C .B which -a ls /bin/ls /usr/bin/ls .fam T .nf .br .ne 5 .SH CAVEATS None. .br .ne 5 .SH SEE ALSO csh(1), cut(1), echo(1), which(1) .br .ne 5 .SH AUTHOR SPPSYM_AUTHOR_NAME .br .ne 5 .SH COPYRIGHT & DISTRIBUTION POLICY Copyright (C) 1995-SPPSYM_RELEASE_YEAR SPPSYM_AUTHOR_NAME .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.