Bash: Extract Range with Regular Expressioin (maybe sed?)

Posted by sixtyfootersdude on Stack Overflow See other posts from Stack Overflow or by sixtyfootersdude
Published on 2010-04-12T14:48:18Z Indexed on 2010/04/12 15:03 UTC
Read the original article Hit count: 373

Filed under:
|
|
|

I have a file that is similar to this:

<many lines of stuff>
SUMMARY:
<some lines of stuff>
END OF SUMMARY

I want to extract just the stuff between SUMMARY and END OF SUMMARY. I suspect I can do this with sed but I am not sure how. I know I can modify the stuff in between with this:

sed "/SUMMARY/,/END OF SUMMARY/ s/replace/with/" fileName

(But not sure how to just extract that stuff).

I am Bash on Solaris.

© Stack Overflow or respective owner

Related posts about regex

Related posts about sed