zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: Bug in alias expansion
Date: Mon, 16 Nov 2015 06:42:54 +0100	[thread overview]
Message-ID: <CAHYJk3SPJzi9EM_JwPVEOuuCvu6z-NiVRWxuXO-mTbOMUAib+Q@mail.gmail.com> (raw)
In-Reply-To: <151115192407.ZM20747@torch.brasslantern.com>

On Mon, Nov 16, 2015 at 4:24 AM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Nov 16,  1:50am, Mikael Magnusson wrote:
> } Subject: Re: Bug in alias expansion
> }
> } > In older versions of zsh it gagged in a different way:
> } >
> } > % alias -g foo='echo x)$(:'
> } > % print $(foo)
> } > zsh: parse error near `)'
> } > zsh: parse error in command substitution
> }
> } This error is definitely what I would expect from the above command.
> } It's expanded in the subshell
>
> If this were a normal command alias, I'd agree with you, but this is
> a global alias -- the parent shell should expand it wherever it is an
> unquoted shell word in the original command line, before the subshell
> is ever started.

As the commands you didn't quote show, this doesn't seem to be the
case, and I don't think it should either.

> The "workaround" I posted in 37122 behaves the way you're thinking,
> but shouldn't be necessary.
>
> I suppose there's an argument to be made that a word inside $(...) is
> "quoted", but if so. the example I showed for "typeset frobozz[$(foo)]"
> (where xyz is expanded before parse_subscript() is called) must be
> wrong.


-- 
Mikael Magnusson


  reply	other threads:[~2015-11-16  5:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 18:03 Kynn Jones
2015-11-14  1:03 ` Bart Schaefer
2015-11-14 18:57   ` Kynn Jones
2015-11-14 19:03     ` Bart Schaefer
2015-11-14 19:19       ` Kynn Jones
2015-11-14 21:40         ` Bart Schaefer
2015-11-14 22:20           ` Kynn Jones
2015-11-15 20:03 ` Peter Stephenson
2015-11-15 21:52   ` Bart Schaefer
2015-11-15 22:26     ` Bart Schaefer
2015-11-15 22:48   ` Bart Schaefer
2015-11-16  0:50     ` Mikael Magnusson
2015-11-16  3:24       ` Bart Schaefer
2015-11-16  5:42         ` Mikael Magnusson [this message]
2015-11-18 10:42     ` Peter Stephenson
2015-11-18 14:13       ` Peter Stephenson
2015-11-18 15:52         ` Bart Schaefer
2015-11-18 16:14           ` Peter Stephenson
2015-11-18 18:09             ` Bart Schaefer
2015-11-17 17:29   ` Peter Stephenson
2015-11-18  4:55     ` Bart Schaefer
2015-11-18 10:30       ` Peter Stephenson

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=CAHYJk3SPJzi9EM_JwPVEOuuCvu6z-NiVRWxuXO-mTbOMUAib+Q@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@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).