Re: [Nolug] Finding out what "yesterday" was, from bash

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: Sat, 01 May 2004 00:10:33 -0500
Message-Id: <1083388232.2487.12.camel@haggis.homelan>

On Fri, 2004-04-30 at 23:48 -0500, -ray wrote:
> On Fri, 30 Apr 2004, Ron Johnson wrote:
>
> > Hi,
> >
> > How can a script find out what yesterday was?
> >
> > In it's "time/date" commands, OpenVMS has defined the constants
> > YESTERDAY, TODAY, and TOMORROW.
> >
> > Does date(1) have anything similar?
>
> DATE=`date --date '1 day ago'`
>
> or date --date 'yesterday', with GNU date.

Sweet... (Although it's not in the man page :()

$ date --date '1 month ago' +"%Y-%m"
2004-04

-- 
Ron Johnson <ron.l.johnson@cox.net>
___________________
Nolug mailing list
nolug@nolug.org
Received on 05/01/04

This archive was generated by hypermail 2.2.0 : 12/19/08 EST