try:
Code:
#!/bin/bash
suffix="aos"
tables_aos=("A" "B" "C")
echo table data = ${tables_aos[@]}
name=tables_${suffix}[@]
echo name of table = $name
data=${!name}
echo all the data = ${data[@]}
echo individual data:
for arg in ${data[@]}; do
echo $arg
done
gives:
Code:
table data = A B C
name of table = tables_aos[@]
all the data = A B C
individual data:
A
B
C
your #! is wrong it should be an absolute path and BASH is usually in /bin/bash rather than /usr/bin/bash
!is redirect and you should try to avoid eval where possible
USE CODE TAGS!