Re: Doc-bug Bash manpage:

2011-08-13 Thread Linda Walsh
Seems like this a bug in how 'groff' is configured to display various characters. Sorry the waste of space. Linda Walsh wrote: In my bash package: rpm -qi bash Name : bash Relocations: (not relocatable) Version : 4.1 Vendor: openSUSE Release : 20.25.1 Build Date: Sun 27 Feb 2011 05:51:

Syntax Question...

2011-08-13 Thread Linda Walsh
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:

Re: Syntax Question...

2011-08-13 Thread Michael Witten
On Sat, Aug 13, 2011 at 23:41, Linda Walsh wrote: > ${#${!name}[*]} > bash: ${#${!name}[*]}: bad substitution It's probably what you're trying to avoid, but you'll probably have to construct and then eval the right code by hand: $(eval "echo \${#$name[*]}")

Re: Syntax Question...

2011-08-13 Thread Dennis Williamson
On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh 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 t

Re: Syntax Question...

2011-08-13 Thread Michael Witten
On Sun, Aug 14, 2011 at 00:49, Dennis Williamson wrote: > On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh 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 na

Re: Syntax Question...

2011-08-13 Thread Linda Walsh
` Dennis Williamson wrote: On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh wrote: 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

Re: Syntax Question...

2011-08-13 Thread Linda Walsh
` Michael Witten wrote: On Sat, Aug 13, 2011 at 23:41, Linda Walsh wrote: ${#${!name}[*]} bash: ${#${!name}[*]}: bad substitution It's probably what you're trying to avoid, but you'll probably have to construct and then eval the right code by hand: $(eval "echo \${#$name[*]}")

Re: Syntax Question...

2011-08-13 Thread Pierre Gaston
On Sun, Aug 14, 2011 at 7:51 AM, Linda Walsh wrote: > > > > ` Dennis Williamson wrote: >> >> On Sat, Aug 13, 2011 at 6:41 PM, Linda Walsh wrote: >> >>> >>> I have to use 'indirect' syntax:     ${!name} >>> But that doesn't seem to play well with array syntax: >>> ${#${!name}[*]}    #  bash: ${#${

Re: Syntax Question...

2011-08-13 Thread Michael Witten
On Sun, Aug 14, 2011 at 04:55, Linda Walsh wrote: > > > > ` Michael Witten wrote: >> >> On Sat, Aug 13, 2011 at 23:41, Linda Walsh wrote: >> >>> >>> ${#${!name}[*]} >>> bash: ${#${!name}[*]}: bad substitution >>> >> >> It's probably what you're trying to avoid, but you'll probably have to >> cons

Re: Syntax Question...

2011-08-13 Thread Michael Witten
On Sun, Aug 14, 2011 at 05:56, Michael Witten wrote: > On Sun, Aug 14, 2011 at 04:55, Linda Walsh wrote: >> >> >> >> ` Michael Witten wrote: >>> >>> On Sat, Aug 13, 2011 at 23:41, Linda Walsh wrote: >>> ${#${!name}[*]} bash: ${#${!name}[*]}: bad substitution >>> >>> It's prob