Annotation of src/usr.bin/which/which.1, Revision 1.4
1.4 ! millert 1: .\" $OpenBSD: which.1,v 1.3 1997/01/07 15:57:48 niklas Exp $
1.1 deraadt 2: .\" Copyright (c) 1980, 1991 Regents of the University of California.
3: .\" All rights reserved.
4: .\"
5: .\" Redistribution and use in source and binary forms, with or without
6: .\" modification, are permitted provided that the following conditions
7: .\" are met:
8: .\" 1. Redistributions of source code must retain the above copyright
9: .\" notice, this list of conditions and the following disclaimer.
10: .\" 2. Redistributions in binary form must reproduce the above copyright
11: .\" notice, this list of conditions and the following disclaimer in the
12: .\" documentation and/or other materials provided with the distribution.
13: .\" 3. All advertising materials mentioning features or use of this software
14: .\" must display the following acknowledgement:
15: .\" This product includes software developed by the University of
16: .\" California, Berkeley and its contributors.
17: .\" 4. Neither the name of the University nor the names of its contributors
18: .\" may be used to endorse or promote products derived from this software
19: .\" without specific prior written permission.
20: .\"
21: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31: .\" SUCH DAMAGE.
32: .\"
33: .\" from: @(#)which.1 6.3 (Berkeley) 4/23/91
34: .\"
1.4 ! millert 35: .Dd February 21, 1997
1.1 deraadt 36: .Dt WHICH 1
1.4 ! millert 37: .Os
1.1 deraadt 38: .Sh NAME
39: .Nm which
1.4 ! millert 40: .Nd "locate a program file (or files) in the path"
1.1 deraadt 41: .Sh SYNOPSIS
42: .Nm which
43: .Op Ar name
44: .Ar ...
45: .Sh DESCRIPTION
46: .Nm Which
47: takes a list of names and looks for the files which would be
48: executed had these names been given as commands.
1.4 ! millert 49: Each argument is searched for along the user's path.
! 50: .Sh RETURN VALUES
1.3 niklas 51: The
1.4 ! millert 52: .Nm
1.3 niklas 53: utility exits with one of the following values:
54: .Bl -tag -width 4n
55: .It 0
56: All names got successfully resolved.
57: .It 1
58: Some names got resolved but not all.
59: .It 2
60: No names got resolved.
1.4 ! millert 61: .It -1
! 62: A system error occurred.
1.3 niklas 63: .El
1.4 ! millert 64: .Sh DIAGNOSTICS
! 65: A diagnostic is given if an executable file with the argument
! 66: name was not found in the path.
! 67: .Sh ENVIRONMENT VARIABLES
! 68: .Bl -tag -width PATH
! 69: .It Ev PATH
! 70: .Nm
! 71: uses the environment variable
! 72: .Ev PATH
! 73: as a colon-separated list of directories in which to find executables.
! 74: If
! 75: .Ev PATH
! 76: is not set, and the given name is not a fully-qualified
! 77: or relative pathname,
! 78: .Nm
! 79: will fail.
1.1 deraadt 80: .El
1.4 ! millert 81: .Sh CAVEATS
! 82: The
! 83: .Nm
! 84: command formerly was a
! 85: .Xr csh 1
! 86: script and could expand aliases.
! 87: .Xr csh 1
! 88: now has a built-in
! 89: .Nm
! 90: comand so this version is intended for use
! 91: with other shells like
! 92: .Xr sh 1 .
! 93: .Sh SEE ALSO
1.1 deraadt 94: .Xr csh 1 ,
1.4 ! millert 95: .Xr sh 1 ,
! 96: .Xr environ 7
1.1 deraadt 97: .Sh HISTORY
1.4 ! millert 98: A
1.1 deraadt 99: .Nm
100: command appeared in
101: .Bx 3.0 .