From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18564 invoked by alias); 14 Jul 2013 22:57:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17876 Received: (qmail 27833 invoked from network); 14 Jul 2013 22:57:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130714155737.ZM9047@torch.brasslantern.com> Date: Sun, 14 Jul 2013 15:57:37 -0700 In-reply-to: Comments: In reply to Thorsten Kampe "Re: How to iterate over an array of associative arrays" (Jul 14, 9:57pm) References: <20130714182117.221d3501@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Thorsten Kampe , zsh-users@zsh.org Subject: Re: How to iterate over an array of associative arrays MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jul 14, 9:57pm, Thorsten Kampe wrote: } } Say I have... } } AssocArr1=(key1 value11 } key2 value12) } } AssocArr2=(key1 value21 } key2 value22) } } So how do I iterate over... } } array=(AssocArr1 AssocArr2) Using the example in my earlier email ... for ref in $array do print ${${(P)ref}[${${(@kP)ref}[(i)key2]}]} done