Re: Is there array of array in bash?



On Tue, 01 Jul 2008 19:55:53 -0300, PengYu.UT@xxxxxxxxx <PengYu.UT@xxxxxxxxx> wrote:

Hi,

I'm trying to use an array of array in bash in the following script.
It is not working. Is there a way to make it work?

Thanks,
Peng

$cat ./array_of_array.sh
#!/bin/bash

coordinates=((0 0) (1 1))

for c in $coordinates[*];
do
echo $c
done

$ ./array_of_array.sh
./array_of_array.sh: line 3: syntax error near unexpected token `('
./array_of_array.sh: line 3: `coordinates=((0 0) (1 1))'
[*]



$ coordinates=(0 1 2 3)
$ for c in ${coordinates[*]};do echo $c;done
0
1
2
3
$
.