Question about grep

Our Pal Al opa at avalon.rockefeller.edu
Tue Mar 16 16:02:59 PST 2004


I'm writing a progam to process my Retrospect backup report files. For the
most part it's vastly easier to do it Applescript and I'm nearly done, but
one part is easier with a shell script. A 'grep -v Successful' so I can grab
out all the lines that do NOT have "Successful" in it (i.e. the failure
lines). The Applescript uses a "do shell script" to execute that.

Here's my grep question - the report has everything in it going back for the
many YEARS my server has been in service! Retrospect spits it all out. I can
sort recent events to the top, but I'd really like to just lop off anything
older than a week and have a smaller file entirely.

So in a file with lots of lines like this -

3/15/2004    5:58 PM    Drogo-OS X (21.177)    Macintosh HD    -24001
user canceled    0:34:00    129.85.21.177

How can I formulate grep to grab on the mm/dd/yyyy field and pull out "any
lines where the date is no older than 7 days ago"?

- Al


-- 
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Isn't it a bit unnerving that doctors call
what they do "practice"?

http://home.nyc.rr.com/attilan/wonderfal/   <--    NEW location!
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-



More information about the X-Unix mailing list