Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: array prepend
- X-seq: zsh-users 17563
- From: rahul <rahul2012@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: array prepend
- Date: Tue, 15 Jan 2013 00:18:11 +0530
- Cc: zsh-users@xxxxxxx
- 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==
- In-reply-to: <130114073236.ZM6828@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <50EFB80D.30002@sergio.spb.ru> <22417.1357954693@thecus.kiddle.eu> <20130113185141.4394d532@pws-pc.ntlworld.com> <CACQNQ9O5Te2xp8j2MjUsVN5gXQ9o2eySy=Baqj-t3htkKZgNKQ@mail.gmail.com> <130114073236.ZM6828@torch.brasslantern.com>
On Mon, Jan 14, 2013 at 9:02 PM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author