List = 1 2 3 4 5for i in $LISTdosum=`expr $l_$i + $b`donehere l_1, l_2, l_3, l_4 and l_5 are variables having some values.when I am trying to access those values within the for loop using loop variable i, the value of i is getting substituted in the expression i.e the statement (1 + $b) is getting executed instead of ($l_1 + $b). I have tried various combinations of $ symbol and also used paranthesis but nothing seems to be working.Please help!!
accessing loop variable within a loop
bash