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

Odd expansion behavior



Hi.

I'm observing something odd. It might be a bug, but I don't understand
it well-enough to call it that.

I see this:

$ x=(1 2 3); echo xxx${^x}
xxx1 xxx2 xxx3

This output makes sense. However something slightly different is strange:

$ x=(1 2 3); y=xxx${^x}; echo $y
xxx1 2 3

Here the ${^x} form turns on the RC_EXPAND_PARAM option, and it's
apparently not kicking in in the second (broken) case. Even if I setopt
it, I still don't have this working.

I asked on #zsh and osse helpfully pointed out that this can be made to
work by expressing the assignment as 'y=(xxx${^x})' instead, which does
work.

But shouldn't it work the other way as well? osse wasn't sure why the
original form wasn't working, so I'm reporting it here as a maybe-bug.

Thanks

dima



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