this seems like your 'homework' to do ...
you will need to count how many lines columns is there
1
2
3
4
5
6
7
is 7 lines.
and now you have to do the loop 7 times printing out the output "for i"
it could look like this:
1. count how many lines/columns ( linesno=7 )
2. define i=1
Code:
while i <= linesno
do
n=1
while n <= linesno
do
print $i, " " , $n (1.st time run i=1, n=1, giving otput like: 1 1 )
n+1 (now n becomes 2 which is still less than or not equal to linesno=7)
done
i+1 ( now i gets 2)
done
is this what you are looking for ?
P.S. THIS is not really the script code and it will not work on any system if you run it, thus it needs the language structure if the script is meant for shell or PERL or ...