From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Samuel Subject: Re: test the file date Date: Tue, 10 Jun 2003 16:03:30 -0700 Sender: linux-admin-owner@vger.kernel.org Message-ID: <3EE663C2.9020505@bcgreen.com> References: <15497219844.20030610115010@euskalnet.net> <3EE64792.5070704@bcgreen.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: "Mr. James W. Laferriere" Cc: =?ISO-8859-1?Q?C=E9sar_Soler?= , linux-admin@vger.kernel.org Mr. James W. Laferriere wrote: > On Tue, 10 Jun 2003, Stephen Samuel wrote: >>Note that it takes a bit more magic to properly come up with >>a date string for yesterday... I can think of a perl script >>that could do it: >>----------------------- >>#!/usr/bin/perl >>die "Usage: $0 number_of_days_ago\n" >>$days_ago=$ARGV[0]; >>( $sec, $min,$hour,$mday,$mon,$year ) = localtime(time-$days_ago*3600*24); >>printf "%02d%02d%02d\n", $year % 100 , $mon+1, $mday; >>----------------------- > > Try using gdate(date) like so . > date "+%y%m%d" --date="1 days ago" Yay! they've modularized the date-pareing functions of 'at'! -- Stephen Samuel +1(604)876-0426 samuel@bcgreen.com http://www.bcgreen.com/~samuel/ Powerful committed communication, reaching through fear, uncertainty and doubt to touch the jewel within each person and bring it to life.