zsh-users
 help / color / mirror / code / Atom feed
From: "Lawrence Velázquez" <larryv@zsh.org>
To: "Ray Andrews" <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: can print but not assign to variable
Date: Wed, 26 Oct 2022 20:36:47 -0400	[thread overview]
Message-ID: <93794d01-8f2c-4f3f-8729-695d47c82682@app.fastmail.com> (raw)
In-Reply-To: <fe5b670e-ddb1-5291-3470-fcba2b86c12b@eastlink.ca>

On Wed, Oct 26, 2022, at 8:00 PM, Ray Andrews wrote:
>> With EXTENDED_GLOB enabled, "#i" is treated as a glob, but this
>> fails because it is an invalid pattern.
>>
>> 	% setopt EXTENDED_GLOB
>> 	% var=(#i)$cmd
>> 	zsh: bad pattern: #i
>>
> I crashed into that.  Sheesh, there's one case where EXTENDED_GLOB is 
> limiting.  Very confusing.

EXTENDED_GLOB has nothing to do with it.  The problem is that

    var=(#flags)pattern

is not parsed the way you think it should be, and it ends up being
a different command altogether, regardless of the state of
EXTENDED_GLOB.  (Notice that my NO_EXTENDED_GLOB example *does not
work* -- it just quietly does something unintended.)

-- 
vq


      reply	other threads:[~2022-10-27  0:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 21:11 Ray Andrews
2022-10-26 21:38 ` Roman Perepelitsa
2022-10-26 21:49   ` Ray Andrews
2022-10-26 21:57     ` Lawrence Velázquez
2022-10-26 22:07       ` Ray Andrews
2022-10-26 22:19         ` Lawrence Velázquez
2022-10-27  0:00           ` Ray Andrews
2022-10-27  0:36             ` Lawrence Velázquez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93794d01-8f2c-4f3f-8729-695d47c82682@app.fastmail.com \
    --to=larryv@zsh.org \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).