Annotation of src/usr.bin/which/which.1, Revision 1.3
1.3 ! niklas 1: .\" $OpenBSD: which.1,v 1.2 1996/06/26 05:42:58 deraadt 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: .\"
35: .Dd April 23, 1991
36: .Dt WHICH 1
37: .Os BSD 3
38: .Sh NAME
39: .Nm which
40: .Nd "locate a program file including aliases and paths"
41: .Pq Xr csh 1
42: only)
43: .Sh SYNOPSIS
44: .Nm which
45: .Op Ar name
46: .Ar ...
47: .Sh DESCRIPTION
48: .Nm Which
49: takes a list of names and looks for the files which would be
50: executed had these names been given as commands.
51: Each argument is expanded if it is aliased,
52: and searched for along the user's path.
53: Both aliases and path are taken from the user's
54: .Pa \&.cshrc
55: file.
1.3 ! niklas 56: .Pp
! 57: The
! 58: .Nm which
! 59: utility exits with one of the following values:
! 60: .Bl -tag -width 4n
! 61: .It 0
! 62: All names got successfully resolved.
! 63: .It 1
! 64: Some names got resolved but not all.
! 65: .It 2
! 66: No names got resolved.
! 67: .El
1.1 deraadt 68: .Sh FILES
69: .Bl -tag -width ~/\&.cshrc
70: .It Pa ~/\&.cshrc
71: source of aliases and path values
72: .El
73: .Sh DIAGNOSTICS
74: A diagnostic is given for names which are aliased to more than a single
75: word,
76: or if an executable file with the argument name was not found in the path.
77: .Sh BUGS
78: Must be executed by a
79: .Xr csh 1 ,
80: or some other shell which knows about aliases.
81: .Sh HISTORY
82: The
83: .Nm
84: command appeared in
85: .Bx 3.0 .