List = 1 2 3 4 5
for i in $LIST
do
sum=`expr $l_$i + $b`
done
here 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!!
List = 1 2 3 4 5calls the commandListwith 6 arguments,=being the first of them.$Listand$LISTare two different variables.