I want to insert a string after every 30 lines in my large file. I\'m using mini-sed, which doesn\'t support ~ (tilde) range operator. I\'m looking for sed-only solution please.
This inserts a line every 3 lines;
seq 1 10 | sed ': loop; n; n; a insert n; b loop'
Producing
1 2 3 insert 4 5 6 insert 7 8 9 insert 10
adjust the number of n; commands before the a command accordingly
n;
a