How to read line with variable from file and assign variable through a loop? My file has line xyz_$loop
, now my script has to read line from file xyz_$loop
and then while looping print xyz_1
, xyz_2
, xyz_3
, etc.
I am using shell script my file URL1 contain loop_$i
my script -->
while read p; do
max=10
for (( i=2; i <= $max; ++i )) do
echo $p
done
done <URL1
print following output
loop_$i
loop_$i
loop_$i
but I need output
loop_2
loop_3
loop_4