From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8803 invoked by alias); 14 Jan 2013 18:48:31 -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: 17563 Received: (qmail 4433 invoked from network); 14 Jan 2013 18:48:17 -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,HTML_MESSAGE,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 _netblocks.google.com designates 209.85.223.172 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; bh=kaqfQuN/QSLxH0P0D0oIEtoMZ80vM5Lm/ajSxWLRBS4=; b=KdPSetJhh0nF/ls1SxQ5qGTfimBRD00IQ4WMy4m+9LaCu4ylV+f+LsCeuQp7c8al5H HePHuhhG9xEi/n+ElNzUrC3nydBcNq92/CeL1t8/AxfchrPf3nmQmj1zI4Afx/Lt3iH7 F1cbRgkoqpzvUHQDNEyWIwlWkx1e4ckueZj/xpQdK6nQLRoI3D6NbRJ17IN1TvrXzTzY xBPRBeoWMK2rgB3D0RFUmDCPXKIpotZECKpvJxkdLFiV6l/VJOmfpB06QyWdr7IGlTLz Y6QHQqJlqbEnnYClv/syHmro5GOR4SPSEjPlZ91BRNhwBSMnkU2MUxW5nUkjvwuXj7Z3 0cCQ== MIME-Version: 1.0 In-Reply-To: <130114073236.ZM6828@torch.brasslantern.com> References: <50EFB80D.30002@sergio.spb.ru> <22417.1357954693@thecus.kiddle.eu> <20130113185141.4394d532@pws-pc.ntlworld.com> <130114073236.ZM6828@torch.brasslantern.com> Date: Tue, 15 Jan 2013 00:18:11 +0530 Message-ID: Subject: Re: array prepend From: rahul To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=bcaec51b1b4f4c53b404d3441610 --bcaec51b1b4f4c53b404d3441610 Content-Type: text/plain; charset=UTF-8 On Mon, Jan 14, 2013 at 9:02 PM, Bart Schaefer wrote: > On Jan 14, 10:18am, rahul wrote: > } > } I was wondering what the way for inserting into an array is. Is the > } following the simplest or most direct way: > } > } $FOO[1,2] xxx $FOO[3,-1] > > Probably > > FOO[N]+=(xxx) > > Note this is distinct from > > FOO[N]+=xxx > > which will string-append xxx to the value stored at $FOO[N]. > Wow! I was not going to ask this, since i have been asking too many questions, but after reading your reply I can't resist asking this. I was hoping to assign lists (arrays) to an associative array, and got the error which is well documented on the internet. But no one has given any workaround or alternative to this. FOO[a]=("a command" "some text" "etc etc") zsh: FOO: attempt to set slice of associative array Is the only alternative to do the following: FOO_a=( a list) FOO_b=(another list) -- thx, rahul --bcaec51b1b4f4c53b404d3441610--