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

RE: ${(A)=xxx} - second go - now real bug.



>
> ${foo=bar} - the same as foo=bar (with blanks quoted, 'course)
> ${(A)foo=bar}, ${(AA)foo=bar} -
>              the same as foo=(bar)
>

Some more question.

Documentation says "word". It prohibits ${foo=bar baz} because ``bar baz'' is
not a word. Either documentation or shell should be corrected :-)

Assuming that blanks are valid, I _do_ mean ${(A)foo=$bar $baz} should be the
same as foo=($bar $baz):

bor@itsrm2:~%> foo='bar baz'
bor@itsrm2:~%> bar='baz bad'
bor@itsrm2:~%> baz=($foo $bar)
bor@itsrm2:~%> print -l $baz
bar baz
baz bad

Note, that neither $foo nor $bar are word splitted. It is not the same, as first
compute ``$foo $bar'' and split it.

If blanks are not valid - then it is much more simple. We only have to make sure
that arrays are preserved and not converted to scalars.

How is ``bar'' in "${(A)foo=bar}" interpreted? Is it quoted or not? That is
important to decide, what value ``foo'' gets (but the value of substitution
won't change :-)

/andrej



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