bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Syntax Question...


From: Linda Walsh
Subject: Syntax Question...
Date: Sat, 13 Aug 2011 16:41:33 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666




I want to have an array of  'names'.

given a name, "X", I had a prefix, _p_, so have _p_X,
I want to access / manipulate it as an array.

so given I pass in a name in a var, I have to use 'indirect' syntax:

${!name}

But that doesn't seem to play well with array syntax:

${#${!name}[*]}
bash: ${#${!name}[*]}: bad substitution

What syntax would I use for this?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]