On Wed, Oct 29, 2003 at 12:58:21PM -0500, Xpression wrote:
>         Hi all, I'm logging certain types of files to a daily grouping with
> the following format `date +%v` and the output format for today is eg.
> 29-Oct-2003, it's fine but this happens at 12:00 pm at night to rotate
> everyday, and I want to check and edit some lines on the file that was
> recorded but date is the actual and date +%v return me the date of today and
> not of yesterday, is there a way to recognize the past file ???

You can produce the date formatted as you wish but for 1 day ago by:

    % date -v-1d +%v

It's also a good tip when dealing with files with a datestamp in their
name if you use a format more like:

    % date +%Y-%M-%d

(ie. 2003-10-29 for today).  This has the very useful property that
your directory listing will come out in *date* order.

        Cheers,

        Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to