Shouldn't STARTPOINT be outside of the loop?
Code:
STARTPOINT=0
while [[ ${NUMBEROFGROUPS} -gt 0 ]]; do # {
CURRENTGROUP=${NUM:${STARTPOINT}:3}
echo ${CURRENTGROUP}
let STARTPOINT=$(( ${STARTPOINT} + 3 ))
let NUMBEROFGROUPS=$(( ${NUMBEROFGROUPS} -1 ))
done # }
And I suggest using (( )) instead. It's more efficient and you don't have to use $ with names.
Btw, I think the condition of that loop makes it go infinite.