/bin/date and coreutils

Elias Pipping pipping at macports.org
Mon May 7 12:09:18 PDT 2007


Alright, forget what I said ;)

On May 7, 2007, at 8:59 PM, Marc André Selig wrote:

> On 5/7/07, David Liontooth <liontooth at cogweb.net> wrote:
>> In OSX, /bin/date doesn't support the -d switch
>
> But it does have the -r switch. ;-)
>
> [...]
>
>> To pick
>> the date, I use
>>
>>     DAY="$(date -d "-$1 day" +%F)"
>>
>> The -d switch allows me to subtract days (or minutes or seconds) from
>> today's date.
>>
>> Is there a way to subtract n days from a date using the OSX date  
>> utility?
>
> Something like this?
>
> date -r `date +%s-n*24*60*60|bc` +%F
>
> Regards,
> Marc
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-users




More information about the macports-users mailing list