From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13361 invoked by alias); 14 Jan 2017 17:11:40 -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: 22376 Received: (qmail 2341 invoked from network); 14 Jan 2017 17:11:40 -0000 X-Qmail-Scanner-Diagnostics: from mercury.zanshin.com 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(64.84.47.142):SA:0(-0.0/5.0):. Processed in 1.243488 secs); 14 Jan 2017 17:11:40 -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=-0.0 required=5.0 tests=SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at ipost.com designates 64.84.47.142 as permitted sender) Date: Sat, 14 Jan 2017 09:11:04 -0800 (PST) From: Bart Schaefer Reply-To: Bart Schaefer To: Ray Andrews cc: zsh-users@zsh.org Subject: Re: whence question In-Reply-To: Message-ID: References: <652bcc3f-7365-2e52-d39c-8576278606bc@eastlink.ca> <7b890e89-d01b-ab5c-32bf-b75bfa8d945c__41234.9168131643$1484374276$gmane$org@eastlink.ca> <20170114064807.GA31410@fujitsu.shahaf.local2> User-Agent: Alpine 2.00 (LRH 1167 2008-08-23) X-Face: "f/X=UCVgd*^c>+x(gMq0at?e:woX+;'snkkRzc3SX<0AZ (/PS4.M2hzGS9X:Qj]at_H/%a9K}:-eS<"v_7vX84PG9Bf Zpb`wI!I4geY=or+nWq`3CX`oq&TJR;g^ps|7(MH?jh;bs %vHJfCh5>a*6Re5m|Bidja\\o]>n\A)ib1:yX*T`zR(*h~ %tOw<~!D9{e6h!8M2:d8G2@K>y^1I_Vdy\d\MYe]z7c MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 14 Jan 2017, Ray Andrews wrote: > > $ unsetopt nullglob; unsetopt nonomatch; whence -ma grub-r* > > $ unsetopt nullglob; setopt nonomatch; whence -ma grub-r* > > $ setopt nullglob; setopt nonomatch; whence -ma grub-r* > > $ setopt nullglob; unsetopt nonomatch; whence -ma grub-r* > > Does that contradict? Nuthin' works. The options you're changing only matter when globbing FAILS. If the local file matching grub-r* exists, then globbing SUCCEEDS, and your option changes mean nothing in context. Try adding "unsetopt glob" to the mix (though you'd never want that in regular usage). > Just being devil's advocate here of course but in this case does not the > 'm' switch in effect 'state' an exception? That is, is it not an > explicit request to change the rules vis a vis globing? No, it isn't, because globbing is done by the shell long before it tries to execute the "whence" (or any other) command, so at the time globbing is done "-m" is just another syntactic word with no special meaning. I'm pretty sure you and I have had this conversation before. This isn't like the old DOS shell where the arguments get passed verbatim and it is up to the command to invoke the standard pattern matcher. The order of operations is different.