Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: whence question
- X-seq: zsh-users 22372
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: whence question
- Date: Sat, 14 Jan 2017 06:48:07 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=H/l4PMWxjnPcniNfshqQvc8Lr1o=; b=gyYqHSzQxy/p7ILEobkkN B2LYIrLu6snMZviMML5pJKolx+TtlQEHlzRYAWZP4gMvfqw8xSkpCilmSPOPUvuA 1sSfYZ8cpm3g6SZiAsTm9ODsTrft2TVq9iNS79cHRuQ7upAZHeMu5tCrwdYOaxpu Ek2d+XPsBpznzL9iYBBO+o=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=H/l4PMWxjnPcniNfshqQvc8Lr1o=; b=jPkyU2FQwvK8Klv9pPcG MbWb4hCsgR5VCzo4KB4UVvFteroXR7Ys753n/M2P69Dq5TekWdEJJ0K7XcTIMCup Tc3x91Ekk4T0GGA/Z+iDYA5/WaHk1Hsa+cPdS+QAgTIK/q/u1fEBKjty26ECZfzx Wn77Az77a1i22o8aGIgPgjk=
- In-reply-to: <7b890e89-d01b-ab5c-32bf-b75bfa8d945c__41234.9168131643$1484374276$gmane$org@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <652bcc3f-7365-2e52-d39c-8576278606bc@eastlink.ca> <alpine.LRH.2.00.1701132109250.4560@toltec.zanshin.com> <7b890e89-d01b-ab5c-32bf-b75bfa8d945c__41234.9168131643$1484374276$gmane$org@eastlink.ca>
Ray Andrews wrote on Fri, Jan 13, 2017 at 22:09:54 -0800:
> On 13/01/17 09:11 PM, Bart Schaefer wrote:
> >To expound a little on Daniel's answer, [...]
Thanks, Bart.
> I know that if a glob has no match it's passed verbatim so whence
> sees what it's supposed to see,
That's only true when 'setopt nonomatch' is in effect, which is not the
default. By default, globs that have no match are considered errors.
The NULL_GLOB option selects a third mode. See:
% cd $(mktemp -d)
% echo foo*
zsh: no matches found: foo*
% (setopt nullglob; echo foo*) | nl -ba
% (setopt nonomatch; echo foo*)
foo*
%
> [...] 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,
Right: while there are several ways to make a shell builtin command see
globs in arguments, the default behaviour of existing (released)
commands can't be changed for compatibility reasons.
Also, the existing design has merits: *every* external and builtin
command parses "words with globbing metacharacters" the same way.
«echo *foo» and «whence *foo» and «bar *foo» are all subject to the
same rules. The rules are consistent for everybody. That's a feature.
The most ${adjective} exception to the rule is the '[[' reserved word;
but note that its older variant, '[', abides by the rule.
Cheers,
Daniel
[sorry for that botched interpolation in the last paragraph; I had
nonomatch enabled in my compose window's parameter interpolation code
while I was writing this email. ;-)]
Messages sorted by:
Reverse Date,
Date,
Thread,
Author