I'm trying to access data from an array while in a loop.
this command works fine..
echo "text: ${hnr1[1]}"
and this:
echo "text: ${hnr1[$loopnr]}"
However, this is giving me an headache;
echo "text: ${hnr$loopnr[1]}"
will result in:
**: text: ${hnr$loopnr[1]}: bad substitution**
Anybody knows how to solve this?
Edit: Don't get to hung up on the loop, it was a way for me to test stuff.. The data is:
array **hnr1** has **20** entries regarding **map 1**
array **hnr2** has **20** entries regarding **map 2**
so my optimal function would be:
' data=${hnr$mapnr[$field]} '