eXTReMe Tracker
Dec 162014
 

To search everything within a file between two numbers or strings:

x='string1';
y='string2';
sed -n "/^$x/,/^$y/p"

If the two strings repeat, you will get multiple instances of blocks that are between those two strings.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)