From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11290 invoked by alias); 28 Sep 2016 18:48:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39482 Received: (qmail 9685 invoked from network); 28 Sep 2016 18:48:18 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(37.59.109.123):SA:0(-3.0/5.0):. Processed in 0.487155 secs); 28 Sep 2016 18:48:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at inlv.org does not designate permitted sender hosts) Subject: Re: Is "command" working right, yet? To: Zsh hackers list References: <160202163744.ZM2066@torch.brasslantern.com> <56B761B8.6000507@inlv.org> <160925201328.ZM24563@torch.brasslantern.com> <20160927110820.7661e8ad@pwslap01u.europe.root.pri> <564b0585-4286-a6c6-d64e-b190af5ace57@inlv.org> <20160928113028.42512c91@pwslap01u.europe.root.pri> From: Martijn Dekker Message-ID: <1c0f3af3-068e-32f5-ee52-5122d519a4b8@inlv.org> Date: Wed, 28 Sep 2016 19:37:46 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160928113028.42512c91@pwslap01u.europe.root.pri> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Op 28-09-16 om 11:30 schreef Peter Stephenson: > On Tue, 27 Sep 2016 13:15:23 +0100 > Martijn Dekker wrote: >> > 'command -p' means: ignore the PATH environment variable and do the >> > search as normal, but (if it's a path search) use the system default >> > path as output by the 'getconf PATH' command. That means the -p option >> > has no effect for builtins. > OK, I think that means you want something like the following, where > command -p in combination with -v or -V uses the default path to do the > search and print the result. Nearly. The options combine now, but builtins don't take precedence. As explained above, I'd expect "command -pv echo" to output simply "echo" and not "/bin/echo", because it's a builtin. Also 'command -pv :' should output ':'. Ref.: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html#tag_20_22 (note: the wordage under -p, "Perform the command search using a default value for PATH [...]", does not mean "make it a path search even if there's a matching builtin"; it just means "ignore $PATH and use the system default path instead, if applicable".) Thanks, - M.