xref: /minix3/usr.bin/whereis/which.1 (revision d24fd34cdf396cf9f2e212b219d2484c791864b2)
1*d24fd34cSstux.\"	$NetBSD: which.1,v 1.2 2010/04/05 16:13:58 joerg Exp $
2*d24fd34cSstux.\"
3*d24fd34cSstux.\" Copyright (c) 1980, 1991 Regents of the University of California.
4*d24fd34cSstux.\" All rights reserved.
5*d24fd34cSstux.\"
6*d24fd34cSstux.\" Redistribution and use in source and binary forms, with or without
7*d24fd34cSstux.\" modification, are permitted provided that the following conditions
8*d24fd34cSstux.\" are met:
9*d24fd34cSstux.\" 1. Redistributions of source code must retain the above copyright
10*d24fd34cSstux.\"    notice, this list of conditions and the following disclaimer.
11*d24fd34cSstux.\" 2. Redistributions in binary form must reproduce the above copyright
12*d24fd34cSstux.\"    notice, this list of conditions and the following disclaimer in the
13*d24fd34cSstux.\"    documentation and/or other materials provided with the distribution.
14*d24fd34cSstux.\" 3. Neither the name of the University nor the names of its contributors
15*d24fd34cSstux.\"    may be used to endorse or promote products derived from this software
16*d24fd34cSstux.\"    without specific prior written permission.
17*d24fd34cSstux.\"
18*d24fd34cSstux.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19*d24fd34cSstux.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*d24fd34cSstux.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*d24fd34cSstux.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22*d24fd34cSstux.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*d24fd34cSstux.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*d24fd34cSstux.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*d24fd34cSstux.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*d24fd34cSstux.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*d24fd34cSstux.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*d24fd34cSstux.\" SUCH DAMAGE.
29*d24fd34cSstux.\"
30*d24fd34cSstux.\"     from: @(#)which.1	6.3 (Berkeley) 4/23/91
31*d24fd34cSstux.\"	$NetBSD: which.1,v 1.2 2010/04/05 16:13:58 joerg Exp $
32*d24fd34cSstux.\"
33*d24fd34cSstux.Dd April 23, 1991
34*d24fd34cSstux.Dt WHICH 1
35*d24fd34cSstux.Os
36*d24fd34cSstux.Sh NAME
37*d24fd34cSstux.Nm which
38*d24fd34cSstux.Nd "locate a program file in the users $PATH environment variable"
39*d24fd34cSstux.Sh SYNOPSIS
40*d24fd34cSstux.Nm
41*d24fd34cSstux.Op Fl a
42*d24fd34cSstux.Ar name
43*d24fd34cSstux.Op Ar ...
44*d24fd34cSstux.Sh DESCRIPTION
45*d24fd34cSstux.Nm
46*d24fd34cSstuxtakes a list of names and looks for the files which would be
47*d24fd34cSstuxexecuted had these names been given as commands.
48*d24fd34cSstuxEach argument is searched for along the user's
49*d24fd34cSstux.Ev PATH .
50*d24fd34cSstux.Pp
51*d24fd34cSstuxIf the
52*d24fd34cSstux.Fl a
53*d24fd34cSstuxflag is given,
54*d24fd34cSstux.Nm
55*d24fd34cSstuxwill continue to search the
56*d24fd34cSstux.Ev PATH
57*d24fd34cSstuxuntil all instances of a program file are found.
58*d24fd34cSstux.Sh HISTORY
59*d24fd34cSstuxThe
60*d24fd34cSstux.Nm
61*d24fd34cSstuxcommand appeared in
62*d24fd34cSstux.Bx 3.0 .
63*d24fd34cSstux.Sh BUGS
64*d24fd34cSstuxThis implementation does not expand
65*d24fd34cSstux.Xr csh 1
66*d24fd34cSstuxaliases, and is shell agnostic.
67*d24fd34cSstuxThis is really a feature.
68