title: How can I use bash (grep/sed/etc) to grab a section of a logfile between 2 timestamps?
body: <p>I have a set of mail logs: mail.log mail.log.0 mail.log.1.gz mail.log.2.gz</p>
  
  <p>each of these files contain chronologically sorted lines that begin with timestamps like:</p>
  
  <p><strong>May  3 13:21:12 ...</strong></p>
  
  <p>How can I easily grab every log entry after a certain date/time and before another date/time <strong>using bash</strong> (and related command line tools) without comparing every single line?  Keep in mind that my before and after dates may not exactly match any entries in the logfiles.</p>
  
  <p>It seems to me that I need to determine the offset of the first line greater than the starting timestamp, and the offset of the last line less than the ending timestamp, and cut that section out somehow.</p>