=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/which/which.1,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/which/which.1 1997/01/07 15:57:48 1.3 +++ src/usr.bin/which/which.1 1997/02/21 18:34:59 1.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: which.1,v 1.3 1997/01/07 15:57:48 niklas Exp $ +.\" $OpenBSD: which.1,v 1.4 1997/02/21 18:34:59 millert Exp $ .\" Copyright (c) 1980, 1991 Regents of the University of California. .\" All rights reserved. .\" @@ -32,14 +32,12 @@ .\" .\" from: @(#)which.1 6.3 (Berkeley) 4/23/91 .\" -.Dd April 23, 1991 +.Dd February 21, 1997 .Dt WHICH 1 -.Os BSD 3 +.Os .Sh NAME .Nm which -.Nd "locate a program file including aliases and paths" -.Pq Xr csh 1 -only) +.Nd "locate a program file (or files) in the path" .Sh SYNOPSIS .Nm which .Op Ar name @@ -48,14 +46,10 @@ .Nm Which takes a list of names and looks for the files which would be executed had these names been given as commands. -Each argument is expanded if it is aliased, -and searched for along the user's path. -Both aliases and path are taken from the user's -.Pa \&.cshrc -file. -.Pp +Each argument is searched for along the user's path. +.Sh RETURN VALUES The -.Nm which +.Nm utility exits with one of the following values: .Bl -tag -width 4n .It 0 @@ -64,22 +58,44 @@ Some names got resolved but not all. .It 2 No names got resolved. +.It -1 +A system error occurred. .El -.Sh FILES -.Bl -tag -width ~/\&.cshrc -.It Pa ~/\&.cshrc -source of aliases and path values -.El .Sh DIAGNOSTICS -A diagnostic is given for names which are aliased to more than a single -word, -or if an executable file with the argument name was not found in the path. -.Sh BUGS -Must be executed by a +A diagnostic is given if an executable file with the argument +name was not found in the path. +.Sh ENVIRONMENT VARIABLES +.Bl -tag -width PATH +.It Ev PATH +.Nm +uses the environment variable +.Ev PATH +as a colon-separated list of directories in which to find executables. +If +.Ev PATH +is not set, and the given name is not a fully-qualified +or relative pathname, +.Nm +will fail. +.El +.Sh CAVEATS +The +.Nm +command formerly was a +.Xr csh 1 +script and could expand aliases. +.Xr csh 1 +now has a built-in +.Nm +comand so this version is intended for use +with other shells like +.Xr sh 1 . +.Sh SEE ALSO .Xr csh 1 , -or some other shell which knows about aliases. +.Xr sh 1 , +.Xr environ 7 .Sh HISTORY -The +A .Nm command appeared in .Bx 3.0 .