From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17737 invoked by alias); 21 Mar 2012 21:50:04 -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: 16916 Received: (qmail 5279 invoked from network); 21 Mar 2012 21:50:03 -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.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.213.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ET2AdBS2cPc6c08n7Lbm1PQ0PUXs1ITeQYF6q8WwWcw=; b=uzUPRgdR/kYrSqQsu+6LHD7B/vLRzIdoz/WDIFpb+BIM/LFFx7GNH/pFESIkcN3waX CVBE/kuzaURiqmt4khI1j7Pwtow6BYgapVDT8WmxlMbSlMbVvb1nAP9XVz+7OJJfa1ZB q5gDf5XHLOLxw6TuOwL3OtRRMw0ZEuoUmZcg3MS2Gfu6vX8G4sXFaj/MUne09+4SAshb g8VA3frSLBVBVIgk609g6GmSxJpUFlb9N7L6hNAx+5FgTWsIy7Oh42/QK8GWqe3h1+/T 2/HQ5K3WJFSh2EaTFp2ZCYUKlVXWG5v7HI4yWHijg4ifjgedpwvV5ZTSgnDh71upNuHr IFvg== MIME-Version: 1.0 In-Reply-To: <4F6A4818.3010702@necoro.eu> References: <4F6A4818.3010702@necoro.eu> Date: Wed, 21 Mar 2012 22:44:02 +0100 Message-ID: Subject: Re: Copy assiociative arrays From: Mikael Magnusson To: =?UTF-8?Q?Ren=C3=A9_Neumann?= Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21 March 2012 22:28, Ren=C3=A9 Neumann wrote: > Hi all, > > is it possible to copy associative arrays? > > I.e. have > > declare -A foo bar > foo=3D(muh vier bla "\\sechs") > bar=3D$foo > > using this, bar only contains the values of foo (and using ${(kv)foo} > instead still only makes it a string). You still need the () when assigning to an array, even if the values come from an array expansion bar=3D( ${(kv)foo} ) --=20 Mikael Magnusson