From owner-svn-src-all@freebsd.org Thu Sep 24 16:32:11 2020 Return-Path: Delivered-To: svn-src-all@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 69F483FE0E3; Thu, 24 Sep 2020 16:32:11 +0000 (UTC) (envelope-from xtouqh@mm.st) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4By0tz0gDxz3VTn; Thu, 24 Sep 2020 16:32:10 +0000 (UTC) (envelope-from xtouqh@mm.st) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 7B5C2580409; Thu, 24 Sep 2020 12:32:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 24 Sep 2020 12:32:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mm.st; h=subject :to:references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=fm1; bh=g9piUEXgkka8F ZPw7c0y/Mn8aAUhuZ0c4wyR5QZ1Uq0=; b=LNUN0E3ScRt60tPxxjrqKyBL1VcxM 9NYbKc6kIF9iK2KJRUqz7MRkLv3N5odnXUwnImSdaMaOsx1ZxHlPe8nq3xjLSdGE tUnreLMQAE+BQ8AWb1gmsVPSdVwP4ay7aq++3nO0W5wCdC0fV402aisKsHZF0r1v nKSh7BdQqG9rl4YBR7JSb9VfHWjF0xgc4Lq/glDz1OfcEETaXmZgwHR/2RmOoC5W RiGVXUNLgiFXBCCeimbc3mGf7aEOMHMHmHpeCUerx5N672MLBJN1mEd8PCCa14iJ B6H/5se+qeiEPs9tJ4pNTSqC16w8nttZUkz1QNfi3MFvG7I33pA359sWg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=g9piUEXgkka8FZPw7c0y/Mn8aAUhuZ0c4wyR5QZ1U q0=; b=MEJpSa/yYnvtVFGnVOSXp8mBwieGOOkhdMkQ4kYZTyFGlq/D3neH7SJ0p bX4ZkPwj6TciH9nzyxEYGcDMRfr9qv5VTOgGc/zCBR92NHLx+/h1iCpdCjr+4sF4 frHiMNR/8sPmBr3DoKb+x7Y9nKlzw1HDtv02Ryf0ivJZ3rJ/bqEHpmOIhm1zAclw YTcjywwr4Y5udE3YJwnJKdpJsz17r8kiUSgJhhSFHA0vUH7HLaOB4y3lJsTYcI3E 9dgRfAVedbyAbLK6GmKdiUHo1BqUn5MmYwe8LWGN+0t47PPP9G9JOE59qUlb7j0V FEtGGZ2fTZg5Hd3zCioyYNy4WCWyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudekgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeejnecuhfhrohhmpeigthhouhhqhhesmhhmrdhsthenucggtffrrghtthgvrhhn peefgeegjeeiiedvgfeifeffffduudeiveehudfggeehtdefgeevhefftdfftdejjeenuc ffohhmrghinhepfhhrvggvsghsugdrohhrghenucfkphepledurddvgedtrdduvdegrddu heejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepgi htohhuqhhhsehmmhdrshht X-ME-Proxy: Received: from mercury.lan (unknown [91.240.124.157]) by mail.messagingengine.com (Postfix) with ESMTPA id 6C2B9328005A; Thu, 24 Sep 2020 12:32:09 -0400 (EDT) Subject: Re: svn commit: r366119 - head/usr.bin/which To: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009241611.08OGBrG4024495@repo.freebsd.org> From: xtouqh@mm.st Message-ID: <7ed37edf-b448-2b48-b90f-7b3f7554a17a@mm.st> Date: Thu, 24 Sep 2020 19:32:07 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.3.0 MIME-Version: 1.0 In-Reply-To: <202009241611.08OGBrG4024495@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4By0tz0gDxz3VTn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 16:32:11 -0000 Fernando ApesteguĂ­a 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 which(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 > ============================================================================== > --- 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 utility. > 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=/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? > +.Bd -literal -offset indent > +$ PATH=/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 ,