Advertisement
homer512

paste 6 GNU sed

May 3rd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.23 KB | None | 0 0
  1. #!/bin/sed -f
  2.  
  3. # Concatenates up to 6 lines with ' '
  4. #
  5. #i.e.: '1\n2\n3\n4\n5\n\6\n7\n\8\n9\n10\n11\n12\n13\n14\n'
  6. # becomes '1 2 3 4 5 6\n7 8 9 10 11 12\n13 14\n'
  7. #
  8. # Requires GNU extensions
  9.  
  10. : repeat
  11. N
  12. y/\n/ /
  13. 6~6 ! b repeat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement