Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
pws-19: comparing (k) and (I) for hashes
- X-seq: zsh-workers 6347
- From: "Andrej Borsenkow" <borsenkow.msk@xxxxxx>
- To: "ZSH workers mailing list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: pws-19: comparing (k) and (I) for hashes
- Date: Tue, 25 May 1999 16:23:50 +0400
- Importance: Normal
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
>From manual I got the impression, that ${(k)...} and ${...[(I)...]} do the
same - both return the keys of matching elements. Cf. (I) description:
`I'
like ``i', but gives the index of the last match, or all possible
matching keys in an associative array.
In case of parameters hash, the keys are parameter names, so
bor@itsrm2:~%> print -l ${(k)parameters[(R)scalar*]} | grep foo
foo
bor@itsrm2:~%>
(as expected), but
bor@itsrm2:~%> print -l ${parameters[(I)scalar*]} | grep foo
bor@itsrm2:~%>
What do I do wrong?
/andrej
Messages sorted by:
Reverse Date,
Date,
Thread,
Author