From owner-freebsd-questions@FreeBSD.ORG Wed Oct 29 10:14:19 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F2E316A4CE for ; Wed, 29 Oct 2003 10:14:19 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9546E43F75 for ; Wed, 29 Oct 2003 10:14:15 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h9TICG4b074331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Oct 2003 18:12:46 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id h9TICGWP074330; Wed, 29 Oct 2003 18:12:16 GMT (envelope-from matthew) Date: Wed, 29 Oct 2003 18:12:16 +0000 From: Matthew Seaman To: Xpression Message-ID: <20031029181216.GA58181@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Xpression , FreeBSD-questions References: <002801c39e46$49a3d980$0801a8c0@bloodlust> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <002801c39e46$49a3d980$0801a8c0@bloodlust> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=no version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on happy-idiot-talk.infracaninophile.co.uk cc: FreeBSD-questions Subject: Re: Problem with date... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2003 18:14:19 -0000 --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wi= th > 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 --=20 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 --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/oAMAdtESqEQa7a0RApt5AJ4yazzu5NA+KrkmGhjHc6/KhdDHzACgln2L 38HgG+gH42dF4ayu6Hu/XKg= =qBms -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--