Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: ${(A)=xxx} - second go - now real bug.
- X-seq: zsh-workers 7018
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "ZSH workers mailing list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: RE: ${(A)=xxx} - second go - now real bug.
- Date: Wed, 7 Jul 1999 19:50:28 +0400
- Importance: Normal
- In-reply-to: <002501bec88d$f467f470$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
>
> ${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