Inside the second for loop I am getting the error '${Data${c}Answer[*]}: bad substitution'. I believe it's the $c. Still new to bash script so might be an easy fix but can't seems to figure it out.
declare -a Data1Answer=('0' '3' '4' '6' '9')
declare -a Data2Answer=('5' '7' '9' '11' '13')
for c in {1..2}; do
echo \$c
t=0
java \${prog1} < data\${c}.txt &> user.out
for ans in \${Data\${c}Answer[*]}; do
if grep -q \$ans user.out
then
((t++))
fi
done