Using "seq", If one column is equal to 5, continue the other column
2
votes
1
answer
133
views
For example, I want to start from the far right column, and once that reaches 5, continue the count from the second farthest column.
0.0.0.0
0.0.0.1
0.0.0.2
0.0.0.3
0.0.0.4
0.0.0.5
0.0.1.5
0.0.2.5
0.0.3.5
0.0.4.5
0.0.5.5
0.1.5.5
0.2.5.5
0.3.5.5
0.4.5.5
0.5.5.5
1.5.5.5
2.5.5.5
3.5.5.5
4.5.5.5
5.5.5.5
So far, I was thinking of using:
for i in $(seq 0 5); do echo "0.0.0.$i"; done
and once i == 5
, then well set i=0
, and move the echo to the third position.
Asked by curiousJoe
(57 rep)
Dec 4, 2020, 08:09 AM
Last activity: Dec 5, 2020, 07:55 AM
Last activity: Dec 5, 2020, 07:55 AM