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

Re: splitting in assignment forms of expansion



On 27/09/2012, Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> Hello,
>
> The manpage of zshexpn states about "${=...}":
>
>       Note  that  splitting is applied to word in the assignment forms
>       of spec before  the  assignment  to  name  is  performed.   This
>       affects the result of array assignments with the A flag.
>
> but looks like the splitting isn't applied to word first:
>
> % print -l ${=xx::=foo           bar}
> foo
> bar
> %  print -l $xx
> foo           bar
> %
>
> I'm confused on this. Please help.

If you actually use the (A) flag,
% print -l ${=xx::=foo bar} . $xx . ${(A)=xx::=foo bar} . $xx
foo
bar
.
foo bar
.
foo
bar
.
foo
bar

-- 
Mikael Magnusson



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