Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Unexpected foo==bar errors
- X-seq: zsh-workers 37908
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: Unexpected foo==bar errors
- Date: Sun, 7 Feb 2016 11:16:38 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=uZSYi1m+HJ88kFx9pDaKhWNxSLYZuEsOrDWam9rsJV0=; b=Vp3T5V6mmp++Ry/7o9+g8A9P3k6/CiXmQl5yMcayMcHelEHA0vir6iESPgzpl+NI/T kFozCfyOF4nWnDzwBt2MtajbNHZjGK/xEEukoMDFqqii88hlZdbXIAdwaB2PyK9Awo4B 0zoimd/pk2u9Wu6qFJlpbQiL7+UH9WRSOQqh1KRsRUDDYtAwgXC+EvQieYaGU+AiWibM 91lQNe7qfLo94mHVcNE0fQiIB3bCiSZVo0uNS9LGZckx9ED8AL4lf/+Xd6VkJ1rnwLKL gvaP+I31bZ+zm0GgBj21IUOHhVcJRl+ULgQaOhITduJ04UqJAAYOiaqaoPzO9fzHuWmS zApA==
- In-reply-to: <CAHYJk3QRVQ893fMP+4CmdapK10vx5gP581pY358KSQdR1-sZuQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHYJk3QRVQ893fMP+4CmdapK10vx5gP581pY358KSQdR1-sZuQ@mail.gmail.com>
On Feb 7, 4:57pm, Mikael Magnusson wrote:
}
} I always thought of EQUALS expansion as a form of globbing; should it
} be enabled in these contexts even though regular globbing isn't?
It's expansion, like with a leading tilde, not globbing, so GLOB_ASSIGN
doesn't apply here at all.
MAGIC_EQUAL_SUBST has never controlled expansion occurring in parameter
assignments, it only controls whether expansion occurs in normal command
arguments that LOOK LIKE assignments.
torch% bar==echo
torch% print $bar
/bin/echo
torch% print foo==echo
foo==echo
torch% setopt magicequalsubst
torch% print foo==echo
foo=/bin/echo
torch% setopt no_equals
torch% print foo==echo
foo==echo
torch% bar==echo
torch% print $bar
=echo
torch%
} _tar:70 is
} tf=${~words[3]}
Ooh, that's a fun one: (foo) is being taken as glob qualifiers, which is
a larger problem in this case than the expansion of "=". Then because
globassign is off, the equals expansion (on the empty string) is done,
but the qualifiers are never applied to the result.
If you "setopt shfileexpansion" so that equals applies after globbing
instead of before, the assignment behaves more sensibly, but:
The only use of $tf as far as I can see is to do lookups in the cache.
The apparent intent is to canonicalize the cache name to avoid "tar -tf"
of the same tar file more than once. That optimization may not be worth
the buggy attempt at expansion, and caching the result of =(command) may
not be the best idea in the first place.
I'm not sure exactly what fix to suggest.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author