bug-bash
[Top][All Lists]
Advanced

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

Re: Syntax Question...


From: Dennis Williamson
Subject: Re: Syntax Question...
Date: Sat, 13 Aug 2011 19:49:13 -0500

On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh <address@hidden> wrote:
>
>
>
> 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?
>
>
>
>

Please read BashFAQ/006: http://mywiki.wooledge.org/BashFAQ/006

-- 
Visit serverfault.com to get your system administration questions answered.



reply via email to

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