What you are trying to do can be achieved much better with arrays.
values=( value1 value2 value3 "This is value 4" )
echo "${values[2]}"
values[2]="other_value"
echo "${values[2]}"
Variables can also be used as the index:
i=2
echo "${values[$i]}"
Arrays make looping over the values very easy:
#looping over values
for value in "${values[@]}"; do
echo "$value"
done
#looping over indexes
for index in "${!values[@]}"; do
echo "${values[$index]}"
done
If you don't consider sparse or associative arrays, you can also loop like this:
for (( index=0; index<${#values[@]}; index++ )); do
echo "${values[index]}"
done
Arrays are the right structure for your task. They offer great functionality. For more information on arrays, see: wiki.bash-hackers.org/syntax/arrays and Bash Reference Manual.