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

RE: PATCH: param stuff and was: PATCH: 3.1.5-pws-12: _brace_parameter



>
> It's actually completely predictable, once you know the rule.
>

'course. What I tried to explain, that there is probably a dozen of people,
who know these rules :-( (correct me if I'm wrong)

O.K. Is it intentional?

itsrm2% foo=(axb cxd)
itsrm2% print -l ${(s/x/)foo}
a
b c
d

I won't argue, if this is correct or not. I'd just to point out
a) if this is intentional, it should be documented
b) it is very different from word splitting (which is referred to in
manual). In this case, *every* resulting word is splitted:

itsrm2% foo=("a b" "c d")
itsrm2% print -l ${=foo}
a
b
c
d

The second question is, what is applied first - flags or modifications?
Again, after soms tests :-)

itsrm2% foo=(ax1 bx1)
itsrm2% print -l ${(s/x/)foo%%1*}
a
 b

I don't argue, that it may be predictable. Unfortunately, I simply fail to
find the rule ...

cheers

/andrej

P.S. Please, don't take me too hard. But just try to pretend itself a ZSH
newbie for a while ...



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