Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug in alias expansion



On Mon, Nov 16, 2015 at 4:24 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author