12/08/2015

grep between two lines

sed -n '/test1/,/test2/p' filename
In order to exclude the lines containing test1 and test2, say:
sed -n '/test1/,/test2/{/test1/b;/test2/b;p}' filename