jeo wrote:
Here's a dumb question... What does "${countarray[$index]}" return before this line?
It sounds like when the script gets there, "${countarray[$index]}" is null, and so to the script sees that line literally as "=1"
If you are still interested in pursuing this angle, can you give me some more of the script? Just the array and things involved in making a counting loop maybe?
*********
here's the actual code that I am using, it maybe a syntax error, but it is still puzzling me.
LIMIT=70
for ((index=0; index <= LIMIT ; index++))
do
if [ $used1 = ${numbarray[$index]} ]
then
arrayvalue=${countarray[$index]}
echo -e $arrayvalue
arrayvalue=`expr $arrayvalue + $single`
echo -e "arrayvalue after adding 1 ---->" $arrayvalue
${countarray[$index]}=`expr ${countarray[$index]} + $single`
echo -e "count array ---->" ${countarray[$index]}
fi
done
done
Thanks in advance!