From owner-svn-src-head@freebsd.org Thu Sep 24 16:43:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FDC2421F24; Thu, 24 Sep 2020 16:43:13 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com [209.85.222.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4By17h1p71z3bw4; Thu, 24 Sep 2020 16:43:12 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-ua1-f46.google.com with SMTP id h15so1212873uab.3; Thu, 24 Sep 2020 09:43:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GglN9YQQfs0qAX6gsrlps5mM+aT9OiOPoiKlspC8boM=; b=MUXf5C2tWNslG+6tanbSer79PbRPLuyC1ZqHdjpSgcjfVlmbyPIVgW8aTU/vuqigRI BsyhDi3gedPyK4m59YDhb/DhYNYGn1qmIWS7fpC9M7eJsLuJK+3PM9S58OcwCJiGgC3Q etxWbk72ngltuHwhn36Dk4oi04gjuZX4h5XxYYHIU6Pb5ozESoXDRtUM9qrLOJGm6Ywh Uo6STQ5E2uqYgJmJ4AQd24Vk7snword0VkyxCLVTJUHfoFnyvuyCvk7ex9kGSbgLPPag MWINkMGHBMiS7Q04PV3YX/CReUHV7KrkcP/jV89Bxf/UiNGRLIqcZOf0uXNPhb20hTz7 RHUQ== X-Gm-Message-State: AOAM531CzwtUzRzW8RdfliRzKtsi0tEutxT5zqE/FvPOaOwLBuRnUHK+ Su+WC6Q9GpIiH+bMXAm2PCwwL0gCo9nhgw== X-Google-Smtp-Source: ABdhPJy1X+//h/fYk+hSXR/HTTWgH53K4wwtzLjeOZHiAWfNLOle8nO2M1sK3voMr5VR98suS1Ne+g== X-Received: by 2002:ab0:4425:: with SMTP id m34mr767464uam.19.1600965790092; Thu, 24 Sep 2020 09:43:10 -0700 (PDT) Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com. [209.85.217.52]) by smtp.gmail.com with ESMTPSA id e144sm428731vsc.0.2020.09.24.09.43.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2020 09:43:09 -0700 (PDT) Received: by mail-vs1-f52.google.com with SMTP id 7so2509238vsp.6; Thu, 24 Sep 2020 09:43:09 -0700 (PDT) X-Received: by 2002:a67:18c5:: with SMTP id 188mr5052468vsy.30.1600965789348; Thu, 24 Sep 2020 09:43:09 -0700 (PDT) MIME-Version: 1.0 References: <202009241611.08OGBrG4024495@repo.freebsd.org> <7ed37edf-b448-2b48-b90f-7b3f7554a17a@mm.st> In-Reply-To: <7ed37edf-b448-2b48-b90f-7b3f7554a17a@mm.st> From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Thu, 24 Sep 2020 19:41:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366119 - head/usr.bin/which To: xtouqh@mm.st Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4By17h1p71z3bw4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of fernandoapesteguia@gmail.com designates 209.85.222.46 as permitted sender) smtp.mailfrom=fernandoapesteguia@gmail.com X-Spamd-Result: default: False [-1.72 / 15.00]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.99)[-0.992]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.28)[0.283]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.46:from]; NEURAL_HAM_MEDIUM(-1.01)[-1.006]; FREEMAIL_TO(0.00)[mm.st]; FORGED_SENDER(0.30)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.46:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[fernape@freebsd.org,fernandoapesteguia@gmail.com]; TAGGED_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 16:43:13 -0000 On Thu, Sep 24, 2020 at 6:32 PM 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 , > >