OT: Bash arrays indirection?

2012-02-16 Thread Patrick Lists
Hi, I am trying to do the following in bash: OPTIONS = ( alfa beta gamma ) SUBOPTIONS_alfa = ( alfa0 alfa1 ) count=0 SETCOUNT = ${#SUBOPTIONS_${OPTIONS[$count]}[@]} The SETCOUNT line gives a substitution error. I would like the ${OPTIONS[$count]} to be substituted with alfa so SETCOUNT is:

Re: OT: Bash arrays indirection?

2012-02-16 Thread Ian Malone
On 16 February 2012 08:43, Patrick Lists fedora-l...@puzzled.xs4all.nl wrote: Hi, I am trying to do the following in bash: OPTIONS = ( alfa beta gamma ) SUBOPTIONS_alfa = ( alfa0 alfa1 ) count=0 SETCOUNT = ${#SUBOPTIONS_${OPTIONS[$count]}[@]} The SETCOUNT line gives a substitution error.

Re: OT: Bash arrays indirection?

2012-02-16 Thread Patrick Lists
On 16-02-12 12:13, Ian Malone wrote: On 16 February 2012 08:43, Patrick Listsfedora-l...@puzzled.xs4all.nl wrote: Hi, I am trying to do the following in bash: OPTIONS = ( alfa beta gamma ) SUBOPTIONS_alfa = ( alfa0 alfa1 ) count=0 SETCOUNT = ${#SUBOPTIONS_${OPTIONS[$count]}[@]} The SETCOUNT

Re: OT: Bash arrays indirection?

2012-02-16 Thread Ian Malone
On 16 February 2012 15:41, Patrick Lists fedora-l...@puzzled.xs4all.nl wrote: On 16-02-12 12:13, Ian Malone wrote: On 16 February 2012 08:43, Patrick Listsfedora-l...@puzzled.xs4all.nl  wrote: Hi, I am trying to do the following in bash: OPTIONS = ( alfa beta gamma ) SUBOPTIONS_alfa = (