Idea for date(1) improvement.

Ruslan Ermilov ru at FreeBSD.org
Wed Sep 8 05:12:58 PDT 2004


On Wed, Sep 08, 2004 at 11:44:44AM +0000, Bjoern A. Zeeb wrote:
> On Wed, 8 Sep 2004, Poul-Henning Kamp wrote:
> 
> > I have sometimes needed to get the date of yesterday or last monday
> > and so on for creating filenames.
> >
> > We have this very flexible code in at(1) and cvs(1) for specifying
> > time.
> >
> > Anyone up for making it possible to say:
> >
> > 	date -w "2 days ago"
> >
> > ?
> 
> -w ? isn't it -v ?  date -v-2d ?
> 
> Anyway I do not like both of this ... I think I haven't used -v
> since that one day in 2000....
> 
> : THE PROBLEM:
> : ---------------
> :
> : for this night :
> :
> : > date
> : Sat Apr  1 00:26:11 CEST 2000
> : > date -v-1d +%Y%m
> : 200002
> : > date -v-1d +%Y%m%d
> : 20000229
> : > date
> : Sat Apr  1 00:26:21 CEST 2000
> 
This one has been long fixed, in date/vary.c,v 1.9 (2000/04/05):

: $ env LC_ALL=C TZ=Europe/Prague ./date -v-1d -j 200004010000
: Tue Feb 29 23:00:00 CET 2000
: $ cvs -R up -r1.9 vary.c
: U vary.c
: $ make date
: cc -O -pipe     -c vary.c
: cc -O -pipe      -o date date.o netdate.o vary.o -lutil
: $ env LC_ALL=C TZ=Europe/Prague ./date -v-1d -j 200004010000
: Fri Mar 31 00:00:00 CEST 2000

Recently, more changes to the -v behavior have been made by yar at .


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20040908/cc47252b/attachment.bin


More information about the freebsd-current mailing list