From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17486 invoked from network); 3 Oct 2006 15:56:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Oct 2006 15:56:40 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 23510 invoked from network); 3 Oct 2006 15:56:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Oct 2006 15:56:32 -0000 Received: (qmail 27164 invoked by alias); 3 Oct 2006 15:56:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10778 Received: (qmail 27153 invoked from network); 3 Oct 2006 15:56:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Oct 2006 15:56:24 -0000 Received: (qmail 22407 invoked from network); 3 Oct 2006 15:56:24 -0000 Received: from berd.itl.waw.pl (193.110.137.5) by a.mx.sunsite.dk with SMTP; 3 Oct 2006 15:56:24 -0000 Received: by berd.itl.waw.pl (Postfix, from userid 621) id AC7F642A49; Tue, 3 Oct 2006 17:54:29 +0200 (CEST) Date: Tue, 3 Oct 2006 17:54:29 +0200 From: Wojciech Pietron To: zsh-users@sunsite.dk Subject: Array indirection Message-ID: <20061003155428.GA10503@itl.waw.pl> Mail-Followup-To: zsh-users@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new at itl.waw.pl ZSH_VERSION=4.0.2 Hello, I need to analyze a couple of arrays and decided to take advantage of indirection: ================================================== #!/bin/zsh names=(peter ann) digits=(one two three four) analyze=(names digits) for t in $analyze; do for ((i=1; i<=${(P)#t}; i++)); do #No problems with displaying the indirect tables echo ${(P)t} done done ================================================== I have no problems with displaying the contents of the indirect table inside of the inner loop but how can I do the following operations there: - displaying i-th element of the array; - setting i-th element of the array. I would appreciate any help. Best regards, Wojciech Pietron