Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. My /tmp/foo file looks like this:
  2. trees trees trees trees
  3. trees trees trees trees
  4. trees trees trees trees
  5. trees trees trees trees
  6. trees trees trees trees
  7. -----begin------
  8. aaaaaaaaaaaaaaa
  9. aaaaaaaaaaaaaaa
  10. aaaaaaaaaaaaaaaaaaa
  11. aaaaaaaaaaaaaaaaa
  12. aaaaaaaaaaaaaaaaaaaaaaaa
  13. aaaaaaaaaaaaaaaa
  14. -----end-------
  15. trees trees trees trees
  16. trees trees trees trees
  17. trees trees trees trees
  18. trees trees trees trees
  19. -----begin------
  20. zzzzzzzzzzzzzzzzzzzzzz
  21. zzzzzzzzzzzzzzzzzzzzz
  22. zzzzzzzzzzzzzzzzzzzz
  23. zzzzzzzzzzzzzzzzzzzzz
  24. zzzzzzzzzzzzzzzzzzzzzz
  25. -----end-------
  26. trees trees trees trees
  27. trees trees trees trees
  28. trees trees trees trees
  29.  
  30.  
  31. I want to capture the first stanza between the first begin and end with awk and pipe that down to a file.
  32.  
  33. Then I want to capture the second stanza between begin and end lines and pipe that down to a second file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement