Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- My /tmp/foo file looks like this:
- trees trees trees trees
- trees trees trees trees
- trees trees trees trees
- trees trees trees trees
- trees trees trees trees
- -----begin------
- aaaaaaaaaaaaaaa
- aaaaaaaaaaaaaaa
- aaaaaaaaaaaaaaaaaaa
- aaaaaaaaaaaaaaaaa
- aaaaaaaaaaaaaaaaaaaaaaaa
- aaaaaaaaaaaaaaaa
- -----end-------
- trees trees trees trees
- trees trees trees trees
- trees trees trees trees
- trees trees trees trees
- -----begin------
- zzzzzzzzzzzzzzzzzzzzzz
- zzzzzzzzzzzzzzzzzzzzz
- zzzzzzzzzzzzzzzzzzzz
- zzzzzzzzzzzzzzzzzzzzz
- zzzzzzzzzzzzzzzzzzzzzz
- -----end-------
- trees trees trees trees
- trees trees trees trees
- trees trees trees trees
- I want to capture the first stanza between the first begin and end with awk and pipe that down to a file.
- 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