[TriLUG] OT: bash scripting question

David R. Matusiak dave at matusiak.org
Wed Jun 25 15:48:15 EDT 2003


On Wednesday, June 25, 2003, at 02:40  PM, Jon Carnes wrote:

> On Wed, 2003-06-25 at 13:17, Chris Knowles wrote:
>> I do have a question... date -d "yesterday" and date -d "tomorrow"
>> works, but what's the right way to generate a date 1 week ago,
>
> date -d "-1 week"
>
>>  or an
>> arbitrary date? (30 days ago, 45 days ago, 10 days from now, etc)
>
> date -d "-30 days", date -d "-45 days", date -d "+10 days"
>
> HtH - Jon

just for reference -- Mac OS X (BSD variant) does not like the -d 
option.

date: illegal option -- d
usage: date [-nu] [-r seconds] [+format]
        date [[[[[cc]yy]mm]dd]hh]mm[.ss]




More information about the TriLUG mailing list