./erasehd.sh: line 17: =/dev/sda: 80.0 GB: No such file or directory
No, its ignoring the undeclared variable at the front and trying to execute =/dev/sda... as a command. ;-) .... You want
for each $drivecount
drives[$drivecount]=${info[$count+1]}" "${info[$count+2]}" "${info[$count+3]}
When setting a variable, you never want a leading '$' on a variable, or put another way, typically you don't want a '$' on the left-hand-side of the '=' assignment.
I'm not familiar with the for each construct in bash. Are you sure that is right? I would expect something like
for drivecount in 1 2 3 ; do
....
Finally, the syntax you included is used for referencing an array element, unrelated to assignments.
for dc in 1 2 3 ; do
echo ${drives[$dc]}
done
IHTH.