I am trying to create a nested for loop which will count from 1 to 10 and the second or nested loop will count from 1 to 5.
for ((i=1;i<11;i++));
do
for ((a=1;a<6;a++));
do
echo $i:$a
done
done
What I though the output of this loop was going to be was:
1:1
2:2
3:3
4:4
5:5
6:1
7:2
8:3
9:4
10:5
But instead the output was
1:1
1:2
1:3
1:4
1:5
2:1
...
2:5
3:1
...
and same thing till 10:5
How can I modify my loop to get the result I want! Thanks
echo {1..5}{1..5}.