[BACK]Return to which.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / which

Annotation of src/usr.bin/which/which.1, Revision 1.11

1.11    ! aaron       1: .\"    $OpenBSD: which.1,v 1.10 1999/09/23 04:12:10 alex 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
1.6       millert    43: .Op Fl a
1.8       aaron      44: .Ar name Op Ar ...
1.1       deraadt    45: .Sh DESCRIPTION
1.8       aaron      46: .Nm which
1.1       deraadt    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.
1.6       millert    50: .Pp
                     51: If the
                     52: .Fl a
                     53: flag is given,
                     54: .Nm
                     55: will return a list of all matches instead of just the first match.
1.4       millert    56: .Sh RETURN VALUES
1.3       niklas     57: The
1.4       millert    58: .Nm
1.3       niklas     59: utility exits with one of the following values:
1.11    ! aaron      60: .Pp
        !            61: .Bl -tag -width 4n -compact
1.3       niklas     62: .It 0
1.8       aaron      63: All names were successfully resolved.
1.3       niklas     64: .It 1
1.8       aaron      65: Some names were resolved but not all.
1.3       niklas     66: .It 2
1.8       aaron      67: No names were resolved.
1.4       millert    68: .It -1
                     69: A system error occurred.
1.3       niklas     70: .El
1.4       millert    71: .Sh DIAGNOSTICS
                     72: A diagnostic is given if an executable file with the argument
                     73: name was not found in the path.
1.7       deraadt    74: .Sh ENVIRONMENT
1.4       millert    75: .Bl -tag -width PATH
                     76: .It Ev PATH
                     77: .Nm
                     78: uses the environment variable
                     79: .Ev PATH
                     80: as a colon-separated list of directories in which to find executables.
                     81: If
                     82: .Ev PATH
1.9       aaron      83: is not set, and the given name is not a fully qualified
1.4       millert    84: or relative pathname,
                     85: .Nm
                     86: will fail.
1.1       deraadt    87: .El
1.4       millert    88: .Sh CAVEATS
                     89: The
                     90: .Nm
                     91: command formerly was a
                     92: .Xr csh 1
                     93: script and could expand aliases.
                     94: .Xr csh 1
                     95: now has a built-in
                     96: .Nm
1.10      alex       97: command so this version is intended for use
1.4       millert    98: with other shells like
                     99: .Xr sh 1 .
                    100: .Sh SEE ALSO
1.1       deraadt   101: .Xr csh 1 ,
1.11    ! aaron     102: .Xr find 1 ,
        !           103: .Xr locate 1 ,
1.4       millert   104: .Xr sh 1 ,
1.5       millert   105: .Xr whereis 1 ,
1.4       millert   106: .Xr environ 7
1.1       deraadt   107: .Sh HISTORY
1.4       millert   108: A
1.1       deraadt   109: .Nm
                    110: command appeared in
                    111: .Bx 3.0 .