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

shwordsplit and ksharrays will change rcexpandparam's behavior on empty array



Hello,

I noticed that 'shwordsplit' will change the behavior of 'rcexpandparam'
on empty array:

% zsh -c 'xx=(); print foo${^xx}bar'
<empty>
% zsh -c 'setopt shwordsplit;xx=(); print foo${^xx}bar'
foobar

Not sure if this is a bug. 

And looks like 'ksharrays' can do this, too:

% zsh -c 'setopt ksharrays;xx=(); print foo${^xx}bar'
foobar

Maybe ksharrays lets the $xx evluated as a scalar, a null string, so
foo${^xx}bar is return as foobar?

Thanks.



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