From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6293 invoked from network); 16 Jan 2004 04:23:20 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 16 Jan 2004 04:23:20 -0000 Received: (qmail 5634 invoked by alias); 16 Jan 2004 04:23:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19380 Received: (qmail 5547 invoked from network); 16 Jan 2004 04:23:13 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 16 Jan 2004 04:23:13 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.11.8.53] by sunsite.dk (MessageWall 1.0.8) with SMTP; 16 Jan 2004 4:23:12 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i0G4NBm28858 for zsh-workers@sunsite.dk; Thu, 15 Jan 2004 20:23:11 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1040116042310.ZM28857@candle.brasslantern.com> Date: Fri, 16 Jan 2004 04:23:10 +0000 In-Reply-To: <87vfndnnwe.fsf@naz.lickey.com> Comments: In reply to Matt Armstrong "Is there an idiom for converting an array to an associative array?" (Jan 15, 9:05am) References: <87vfndnnwe.fsf@naz.lickey.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Is there an idiom for converting an array to an associative array? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jan 15, 9:05am, Matt Armstrong wrote: } } I'm looking for an idiom that will convert the array (a b c) into } (a "" b "" c "") so I can assign it easily to an associative array. As it happens ... typeset "assoc[${^array[@]}]=''" should do that particular thing quite effectively, provided that none of the values of $array is * or @. } Right now I've got ugliness like this: } } array=(a b c) } set -A assoc That should be "typeset -A assoc". "set -A" means something entirely different.