1*927269faSwiz.\" $NetBSD: which.1,v 1.4 2022/09/11 20:18:30 wiz Exp $ 270b5dfe8Schristos.\" 370b5dfe8Schristos.\" Copyright (c) 1980, 1991 Regents of the University of California. 470b5dfe8Schristos.\" All rights reserved. 570b5dfe8Schristos.\" 670b5dfe8Schristos.\" Redistribution and use in source and binary forms, with or without 770b5dfe8Schristos.\" modification, are permitted provided that the following conditions 870b5dfe8Schristos.\" are met: 970b5dfe8Schristos.\" 1. Redistributions of source code must retain the above copyright 1070b5dfe8Schristos.\" notice, this list of conditions and the following disclaimer. 1170b5dfe8Schristos.\" 2. Redistributions in binary form must reproduce the above copyright 1270b5dfe8Schristos.\" notice, this list of conditions and the following disclaimer in the 1370b5dfe8Schristos.\" documentation and/or other materials provided with the distribution. 1470b5dfe8Schristos.\" 3. Neither the name of the University nor the names of its contributors 1570b5dfe8Schristos.\" may be used to endorse or promote products derived from this software 1670b5dfe8Schristos.\" without specific prior written permission. 1770b5dfe8Schristos.\" 1870b5dfe8Schristos.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1970b5dfe8Schristos.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2070b5dfe8Schristos.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2170b5dfe8Schristos.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2270b5dfe8Schristos.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2370b5dfe8Schristos.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2470b5dfe8Schristos.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2570b5dfe8Schristos.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2670b5dfe8Schristos.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2770b5dfe8Schristos.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2870b5dfe8Schristos.\" SUCH DAMAGE. 2970b5dfe8Schristos.\" 3070b5dfe8Schristos.\" from: @(#)which.1 6.3 (Berkeley) 4/23/91 31*927269faSwiz.\" $NetBSD: which.1,v 1.4 2022/09/11 20:18:30 wiz Exp $ 3270b5dfe8Schristos.\" 3370b5dfe8Schristos.Dd April 23, 1991 3470b5dfe8Schristos.Dt WHICH 1 3570b5dfe8Schristos.Os 3670b5dfe8Schristos.Sh NAME 3770b5dfe8Schristos.Nm which 38*927269faSwiz.Nd locate a program file in the user's PATH environment variable 3970b5dfe8Schristos.Sh SYNOPSIS 4070b5dfe8Schristos.Nm 4170b5dfe8Schristos.Op Fl a 4270b5dfe8Schristos.Ar name 4370b5dfe8Schristos.Op Ar ... 4470b5dfe8Schristos.Sh DESCRIPTION 4570b5dfe8Schristos.Nm 4670b5dfe8Schristostakes a list of names and looks for the files which would be 4770b5dfe8Schristosexecuted had these names been given as commands. 4870b5dfe8SchristosEach argument is searched for along the user's 4970b5dfe8Schristos.Ev PATH . 5070b5dfe8Schristos.Pp 5170b5dfe8SchristosIf the 5270b5dfe8Schristos.Fl a 5370b5dfe8Schristosflag is given, 5470b5dfe8Schristos.Nm 5570b5dfe8Schristoswill continue to search the 5670b5dfe8Schristos.Ev PATH 5770b5dfe8Schristosuntil all instances of a program file are found. 5870b5dfe8Schristos.Sh HISTORY 5970b5dfe8SchristosThe 6070b5dfe8Schristos.Nm 6170b5dfe8Schristoscommand appeared in 6270b5dfe8Schristos.Bx 3.0 . 6370b5dfe8Schristos.Sh BUGS 6470b5dfe8SchristosThis implementation does not expand 6570b5dfe8Schristos.Xr csh 1 6670b5dfe8Schristosaliases, and is shell agnostic. 6770b5dfe8SchristosThis is really a feature. 68