If I do :-
set -A classifications atype btype ctype dtype etype
for i in ${classifications[@]}
do
echo $i
print $i >> /tmp/class.txt
done
print "${#classifications[@]}"
The array prints as I would expect and the size of the array is 5 (as expected).
If I use an alternative method:
i=0
exec < /tmp/classifications.txt
while read array [i]; do
echo ${array
[i]((i=i+1))
done
print "${#array[@]}"
The array size is 6. I can't figure out why ? Anyone explain this please?
Thanks for your help.

