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

${(s::)VAR} vs "${(s::)VAR}"



Hi!

I was surprised by the following (note that the first output consists of
3 lines while the second output consists of 4; the only difference between
the two cases is that the first one iterates over ${(s::)VAR} while the
second does so over its double-quoted variant, "${(s::)VAR}"):

% (VAR=123; for c ( ${(s::)VAR} ) echo ">$c<")
>1<
>2<
>3<
% (VAR=123; for c ( "${(s::)VAR}" ) echo ">$c<")
>1<
>2<
>3<
><

Even after-the-fact I cannot explain this difference.  I would appreciate
a description of what's going on (and that, I hope, will lead to the
sought-after explanation).

Thanks!

kj


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