Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 2020 19:41:33 +0200
From:      =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= <fernape@freebsd.org>
To:        xtouqh@mm.st
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r366119 - head/usr.bin/which
Message-ID:  <CAGwOe2Z3b%2Bs=KvjDS5RRHh8p6uyycmCgQr%2BR0V0E2WzoDY5M%2BA@mail.gmail.com>
In-Reply-To: <7ed37edf-b448-2b48-b90f-7b3f7554a17a@mm.st>
References:  <202009241611.08OGBrG4024495@repo.freebsd.org> <7ed37edf-b448-2b48-b90f-7b3f7554a17a@mm.st>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 24, 2020 at 6:32 PM <xtouqh@mm.st> wrote:
>
> Fernando Apestegu=C3=ADa wrote:
> > Author: fernape (ports committer)
> > Date: Thu Sep 24 16:11:53 2020
> > New Revision: 366119
> > URL: https://svnweb.freebsd.org/changeset/base/366119
> >
> > Log:
> >    which(1): Add EXAMPLES section to manpage
> >
> >    Add EXAMPLES section showing the use of -a and -s flags and how whic=
h(1)
> >    treates duplicates.
> >
> >    Approved by:       manpages (gbe@)
> >    Differential Revision:     https://reviews.freebsd.org/D26182
> >
> > Modified:
> >    head/usr.bin/which/which.1
> >
> > Modified: head/usr.bin/which/which.1
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> > --- head/usr.bin/which/which.1        Thu Sep 24 15:38:01 2020        (=
r366118)
> > +++ head/usr.bin/which/which.1        Thu Sep 24 16:11:53 2020        (=
r366119)
> > @@ -29,7 +29,7 @@
> >   .\"
> >   .\" $FreeBSD$
> >   .\"
> > -.Dd December 13, 2006
> > +.Dd September 24, 2020
> >   .Dt WHICH 1
> >   .Os
> >   .Sh NAME
> > @@ -62,6 +62,48 @@ command which is similar or identical to this utilit=
y.
> >   Consult the
> >   .Xr builtin 1
> >   manual page.
> > +.Sh EXAMPLES
> > +Locate the
> > +.Xr ls 1
> > +and
> > +.Xr cp 1
> > +commands:
> > +.Bd -literal -offset indent
> > +$ /usr/bin/which ls cp
> > +/bin/ls
> > +/bin/cp
> > +.Ed
> > +.Pp
> > +Same as above with a specific
> > +.Va PATH
>
> .Ev ?
>
> > +and showing all occurrences:
> > +.Bd -literal -offset indent
> > +$ PATH=3D/bin:/rescue /usr/bin/which -a ls cp
> > +/bin/ls
> > +/rescue/ls
> > +/bin/cp
> > +/rescue/cp
> > +.Ed
> > +.Pp
> > +.Nm which
> > +will show duplicates if the same executable is find more than once:
>
> found?

Sorry for that. Fixed in r366122.

Thanks!

>
> > +.Bd -literal -offset indent
> > +$ PATH=3D/bin:/bin /usr/bin/which -a ls
> > +/bin/ls
> > +/bin/ls
> > +.Ed
> > +.Pp
> > +Do not show output.
> > +Just exit with an appropriate return code:
> > +.Bd -literal -offset indent
> > +$ /usr/bin/which -s ls cp
> > +$ echo $?
> > +0
> > +
> > +$ /usr/bin/which -s fakecommand
> > +$ echo $?
> > +1
> > +.Ed
> >   .Sh SEE ALSO
> >   .Xr builtin 1 ,
> >   .Xr csh 1 ,
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGwOe2Z3b%2Bs=KvjDS5RRHh8p6uyycmCgQr%2BR0V0E2WzoDY5M%2BA>