[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Bash 3 - multidimensional arrays?
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Bash 3 - multidimensional arrays? |
Date: |
Mon, 26 Mar 2012 08:10:01 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Mar 23, 2012 at 04:24:12PM -0700, Jester, Jeremiah D wrote:
> Does anyone know if Bash 3 support multi-dimensional arrays? If so,
> could you provide an example?
Not directly. The closest approximation you can get is:
array[i*1000+j]=element
Just pick some constant that's large enough. Bash arrays are sparse,
so it won't actually allocate all the memory for the unused slots.