You might use the address range feature of SED. For example:
sed -n '/patt1/,/patt2/p' filename
This prints lines, beginning with the one containing patt1, and ending with the one containing patt2.
Quote:
lines which starts with words "2008-05-21" and ends with words "2008-05-21"
|
This is ambiguous.....do you mean that each line starts and ends with those words? Or maybe you want a range of line beginning with the one containing pattern1 and ending with the one containing pattern2?
Note that the address range syntax may get confused when the beginning and ending patterns are the same.
For good tutorials on BASH in general:
http://tldp.org
Excellent tutorials on many things, including SED and AWK:
http://www.grymoire.com/Unix