Re: Problem with how to assign an array

2011-02-25 Thread Steven W. Orr
On 2/25/2011 4:22 AM, Andreas Schwab wrote: "Steven W. Orr" writes: 517> r=($(eval echo "\${${a_all[1]}[@]}")) If you use $(eval echo ...) you are almost always doing it wrong. eval "r=(\"\${${a_all[1]}[@]}\")" Andreas. Thanks. I changed things of the form r=($(eval "echo "\${${a_all[

Re: Problem with how to assign an array

2011-02-25 Thread Greg Wooledge
On Thu, Feb 24, 2011 at 06:59:02PM -0500, Steven W. Orr wrote: > I intentionally used the star instead of the atsign because I'm taking > advantage of the fact that these array elements all have no whitespace. So, > after the assignment to a_all, the value of a[0] is equal to the single > string

Re: Problem with how to assign an array

2011-02-25 Thread Andreas Schwab
"Steven W. Orr" writes: > 517 > r=($(eval echo "\${${a_all[1]}[@]}")) If you use $(eval echo ...) you are almost always doing it wrong. eval "r=(\"\${${a_all[1]}[@]}\")" Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5

Re: Problem with how to assign an array

2011-02-24 Thread Steven W. Orr
Ok. Thanks for reading and responding. I thought I expressed myself but I see that I left too much out. I'll amplify below. On 2/24/2011 3:42 PM, Greg Wooledge wrote: On Thu, Feb 24, 2011 at 02:55:13PM -0500, Steven W. Orr wrote: I have three arrays a1=(aaa bbb ccc ddd) a2=(qqq www eee rrr)

Re: Problem with how to assign an array

2011-02-24 Thread Ken Irving
On Thu, Feb 24, 2011 at 03:42:57PM -0500, Greg Wooledge wrote: > On Thu, Feb 24, 2011 at 02:55:13PM -0500, Steven W. Orr wrote: > > I have three arrays > > > > a1=(aaa bbb ccc ddd) > > a2=(qqq www eee rrr) > > a3=(fff ggg hhh) > > > > I then set a_all > > > > a_all=("${a1[*]}" "${a2[*]}" "${a3[*

Re: Problem with how to assign an array

2011-02-24 Thread Greg Wooledge
On Thu, Feb 24, 2011 at 02:55:13PM -0500, Steven W. Orr wrote: > I have three arrays > > a1=(aaa bbb ccc ddd) > a2=(qqq www eee rrr) > a3=(fff ggg hhh) > > I then set a_all > > a_all=("${a1[*]}" "${a2[*]}" "${a3[*]}" Missing ). Also, a far more serious problem, you used * when you should have