From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22950 invoked by alias); 14 Jan 2017 06:10:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22371 Received: (qmail 14943 invoked from network); 14 Jan 2017 06:10:00 -0000 X-Qmail-Scanner-Diagnostics: from mta03.eastlink.ca 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(24.224.136.9):SA:0(-3.9/5.0):. Processed in 1.4194 secs); 14 Jan 2017 06:10:00 -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.9 required=5.0 tests=RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.9 as permitted sender) X-Authority-Analysis: v=2.2 cv=ZvqvEJzG c=1 sm=1 tr=0 a=28Ntk8jg+Dho8ABWn/CRtA==:117 a=28Ntk8jg+Dho8ABWn/CRtA==:17 a=N659UExz7-8A:10 a=NsC4ofCurxtzmfMBB3QA:9 a=pILNOxqGKmIA:10 X-EL-IP-NOAUTH: 24.207.16.108 Subject: Re: whence question To: zsh-users@zsh.org References: <652bcc3f-7365-2e52-d39c-8576278606bc@eastlink.ca> From: Ray Andrews Message-id: <7b890e89-d01b-ab5c-32bf-b75bfa8d945c@eastlink.ca> Date: Fri, 13 Jan 2017 22:09:54 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 13/01/17 09:11 PM, Bart Schaefer wrote: > On Fri, 13 Jan 2017, Ray Andrews wrote: > >> Is this to be expected: >> >> $ touch grub-r >> >> $ whence -ma grub-r* >> > To expound a little on Daniel's answer, touching the file has made > "grub-r*" into a pattern that generates a file name, so instead of looking > for all commands matching the pattern you're looking for all commands > matching the name of the file -- of which there are none. I roughly understand that. I know that if a glob has no match it's passed verbatim so whence sees what it's supposed to see, but the fact that there is a match fouls that up. It's a bit of a bother but I can see that without 'noglob' the shell's zeal for expanding globs is in more or less direct conflict with the intention of the 'm' switch which supposes that whence will handle globing itself. I can also see that that might not be fixable even in theory for reasons of consistency, OTOH I can also speculate that whence might have this noglob built into it automatically whenever the 'm' is used so that there is no conflict -- but that might not be possible without the alias. Certainly what happens is a bit of a gotcha, the incidental local match surely should not matter. Shouldn't 'm' have complete control of globing, since that's what it's for? Dunno, could/should whence be an alias by default? or, since whence is a builtin, might it be possible to prevent the globing in the first place? I understand that that wouldn't be possible with an external command but since it's in the family a bit of hokey pokey might be possible. Sorta whence prepending 'noglob' to itself automatically. Or maybe that's a really dumb idea. >