Reputation: 3452
I would like to concatenate the variable name with shell using the folowing example
val=23
for i in 1 2 3 4
do
a$i=$val + $i
done
but I got error -ash: a1=x: not found !!
how can I concatenate variable name with shell
the purpose is to get a1=24; a2=25 ...
Upvotes: 0
Views: 27