[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Any chance of multi-dimensional arrays?
From: |
Dennis Williamson |
Subject: |
Re: Any chance of multi-dimensional arrays? |
Date: |
Sun, 25 Nov 2012 08:19:48 -0600 |
On Nov 25, 2012 1:37 AM, "Rene Herman" <rene.herman@gmail.com> wrote:
>
> Good day.
>
> I know that bash arrays are 1 dimensional -- but are there any plans for
providing multi-dimensional arrays?
>
> I'm currently writing a larger bash script to manage my (ogg vorbis)
music collection, including maintaining tags. Vorbis files can and (mine)
often will contain repeated tags such as, say, "artist=David Crosby" and
"artist=Graham Nash" and so on and as such, my "artist" variable is an
array.
>
> However, the same things holds for any tag and I'm currently managing
separate title, artist, genre, date, album, tracknumber, disc and
discnumber arrays with fairly ugly "manual loops", whereas I would much
prefer to call them "tag[i]" instead and loop over them with actual for
loops. Given that tag[i] is itself an array, I can't do that though.
>
> When you google for this issue, you find various contrived emulations of
multi-dimensional arrays through function-accessors and such, but that's
not really what I want to do. Thought I'd see if a suggestion that
multi-dimensional arrays would really be much welcome would be welcome
here...
>
> The things I'm trying to do with this script seem to most naturally
belong to the realm of scripts and as such, I'm reluctant to switch to a
different language. And, in fact, I'm sort of satisfied how this is now
working. It's just that the code would much improve from multi-dimensional
array support.
>
> Kind regards,
> Rene
>
Why don't you write it in Python? It will be much easier. You can use
advanced data structures and can even store your data in a database such as
MySQL. Execution will be much faster, too.
- Any chance of multi-dimensional arrays?, Rene Herman, 2012/11/25
- Re: Any chance of multi-dimensional arrays?,
Dennis Williamson <=
- Re: Any chance of multi-dimensional arrays?, Rene Herman, 2012/11/25
- Re: Any chance of multi-dimensional arrays?, Bob Proulx, 2012/11/25
- Re: Any chance of multi-dimensional arrays?, Steven W. Orr, 2012/11/25
- Re: Any chance of multi-dimensional arrays?, Rene Herman, 2012/11/26
- Re: Any chance of multi-dimensional arrays?, Eduardo Bustamante, 2012/11/26
- Re: Any chance of multi-dimensional arrays?, Rene Herman, 2012/11/26
- Message not available
- Re: Any chance of multi-dimensional arrays?, Aharon Robbins, 2012/11/26
Re: Any chance of multi-dimensional arrays?, Greg Wooledge, 2012/11/26
Re: Any chance of multi-dimensional arrays?, Chet Ramey, 2012/11/26