I am new to bash script and I wonder why I recieve the above message. I try to an arithmetic value which comes from the for loop and then I would like to print the array. Can anyone help me?
Thank you in advance!!
#!/bin/bash
declare -a SCORES
for j in `seq 0 5`;
do
SCORES$j="$(sh myscript.sh $DSLAM $j | grep "" -c )"
done
for k in "${SCORES[@]}"
do
echo "message $'\t' $SCORES$k"
done
echo ${#SCORES}
=======
Output
abcd.sh: line 16: SCORES0=3: command not found
abcd.sh: line 16: SCORES1=135: command not found
abcd.sh: line 16: SCORES2=826: command not found
abcd.sh: line 16: SCORES3=107: command not found
abcd.sh: line 16: SCORES4=3: command not found
abcd.sh: line 16: SCORES5=3: command not found
0