bug-bash
[Top][All Lists]
Advanced

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

Re: Syntax Question...


From: Michael Witten
Subject: Re: Syntax Question...
Date: Sun, 14 Aug 2011 02:43:03 +0000

On Sun, Aug 14, 2011 at 00:49, Dennis Williamson
<dennistwilliamson@gmail.com> wrote:
> On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh <bash@tlinx.org> 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

"no force in the universe can put NUL bytes into shell strings usefully"

Ain't that the goddamn Truth!



reply via email to

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