From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24938 invoked from network); 25 May 1999 14:41:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 May 1999 14:41:12 -0000 Received: (qmail 2786 invoked by alias); 25 May 1999 14:40:55 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6347 Received: (qmail 2779 invoked from network); 25 May 1999 14:40:54 -0000 From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: pws-19: comparing (k) and (I) for hashes Date: Tue, 25 May 1999 16:23:50 +0400 Message-ID: <014401bea6a9$71f5f1a0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 >>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