From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19912 invoked from network); 12 Dec 2001 12:31:11 -0000 Received: from ns2.primenet.com.au (HELO primenet.com.au) (?nSsVuOzKj9uV3AVvBbWfgKirmhbonyF3?@203.24.36.3) by ns1.primenet.com.au with SMTP; 12 Dec 2001 12:31:11 -0000 Received: (qmail 5685 invoked from network); 12 Dec 2001 12:31:09 -0000 Received: from sunsite.dk (130.225.247.90) by proxy.melb.primenet.com.au with SMTP; 12 Dec 2001 12:31:09 -0000 Received: (qmail 9543 invoked by alias); 12 Dec 2001 12:30:54 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4534 Received: (qmail 9532 invoked from network); 12 Dec 2001 12:30:53 -0000 From: "Akos Szalkai" Date: Wed, 12 Dec 2001 13:30:53 +0100 To: zsh-users@sunsite.dk Subject: Re: creating associative arrays Message-ID: <20011212133053.B251@2f.hu> References: <20011211194522.A8605@2f.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011211194522.A8605@2f.hu> User-Agent: Mutt/1.3.20i X-Operating-System: Linux 2.4.16 i686 On Tue, Dec 11, 2001 at 07:45:22PM +0100, Akos Szalkai wrote: > I am trying to fill an associative array from a file. If the name of > the file is fixed, e.g. array.txt then the following works: > > : ${(AA)dict::=$( > However, if the filename is given in a parameter then the command: > : ${(AA)dict::=$(<${filename})} > gives the error > zsh: bad set of key/value pairs for associative array. Sorry for having a conversation with myself here, but I realized that it has to do with splitting. If in the second case I use : ${(AA)=dict::=$(<${filename})} or anything similar, like : ${(AA)dict::=${(z)$(<${filename})}} it all works. Thinking about it (hopefully with a clearer head than last night) the error message seemed to be the correct behavior. However, the question remains: why did the first case (with the filename given directly instead of by a parameter) work then? Akos -- Akos Szalkai IT Consultant 2F 2000 Szamitastechnikai es Szolgaltato Kft. Tel: (+36-1)-4887700 Fax: (+36-1)-4887709 WWW: http://www.2f.hu/