Advertisement
homer512

dup mod awk

May 14th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.20 KB | None | 0 0
  1. #!/bin/awk -f
  2.  
  3. # see http://theunixshell.blogspot.de/2014/05/inserting-lines-in-file-using-perl.html
  4.  
  5. {
  6.     print
  7.     repl = sprintf("%d\"", (NR - 1) % 3 + 5)
  8.     print gensub(/.\"$/, repl, 1)
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement