for i in 2 4 8 16
do
for j in 100 1000 10000 100000 1000000
do
cp foo.c bar_$i_$j.c
done
done
I have this nested loop. The output I expected is
bar_2_100.c
bar_2_1000.c
bar_2_10000.c
bar_2_100000.c
bar_2_1000000c.
bar_4_100.c
bar_4_1000.c
bar_4_10000.c
bar_4_100000.c
bar_4_1000000c.
...
But I didn't get $i
part of loop.
My output is
bar_100.c
bar_1000.c
and so on. How can I copy the similar name by using nested loop in shell script?