Bash and $(date)

Heinz-Juergen Oertel oe@port.de
Tue Nov 30 23:39:00 GMT 1999


Brian Jones wrote:
> 
> date -d '1 day ago' +%d
> 
> For the number representing yesterday's day of the month.  See date --help
> for more information.  Of course if cygwin always came with man pages the
> answer would be RTFM.
> 
> Brian

Have you tested it with Cygwin?
I forgot to append cygwin to th mail address, my answer to Eric from 'yesterday'


----------------------------------------------------------------------------
try
$ date -d yesterday


I am using
$ date --version
date (GNU sh-utils) 1.16

at LINUX and Cygwin W95.
But note the differences:
$ uname -a 
CYGWIN_95-4.0 DAVID 20.1 (0.3/1/1) 1998-12-3 20:39:18 i586 unknown

W95:
$ date; date -d yesterday
Mon Nov 15 18:19:52  1999
Mon Nov 15 18:20:52  1999       # + one minute 
$ date; date -d tomorrow
Mon Nov 15 18:20:01  1999
Mon Nov 15 18:21:01  1999       # + one minute 

LINUX:
$ date; date -d yesterday
Monday 15 of November 18:04:30 CET 1999 KW 46
Sunday 14 of November 18:04:30 CET 1999 KW 45

I hope it's a known error
and not in the newer versiion
----------------------------------------------------------------

> > -----Original Message-----
> > From: Eric Rehm [ mailto:rehm@singingfish.com ]
> > Sent: Monday, November 15, 1999 10:41 AM
> > To: cygwin@sourceware.cygnus.com
> > Subject: FW: Bash and $(date)
> >
> >
> > Is there an easy way to get *yesterday's* date using the date command
> > in a bash script?
> >
> > I know how to parse the date, use integer variables, etc.,
> > but I'd rather
> > not have to put in all the year, month, day logic into a script.
> >
> > /eric rehm
> >
> >
> > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> >
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

-- 
with best regards / mit freundlichen Grüßen

  Heinz-Jürgen Oertel

==============================================
Heinz-Juergen Oertel
port GmbH               phone +49 345 77755-0
Regensburger Straße 7c  fax   +49 345 77755-20
D-06132 Halle/Saale     mailto:oe@port.de
Germany                 http://www.port.de
==============================================


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list