Advertisement

05.01.2008 at 11:08PM PDT, ID: 23370834
[x]
Attachment Details

date math in OS X

Asked by medfacit in Tiger (Mac OS 10.4), Bourne-Again Shell (bash), Shell Scripting

Tags: Apple, OS X, 10.4, bash

Hi.

For a bash shell script In OS X 10.4 , how can I subtract 1 day from the current date? So that it works crossing over months, and in the format YYYYMMDD

something like:
if today is 20080501
newdate=date-1

so newdate would be 20080431

Thanks,
ADStart Free Trial
[+][-]05.01.2008 at 11:21PM PDT, ID: 21484849

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Tiger (Mac OS 10.4), Bourne-Again Shell (bash), Shell Scripting
Tags: Apple, OS X, 10.4, bash
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.02.2008 at 04:36AM PDT, ID: 21485803

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2008 at 04:39AM PDT, ID: 21485817

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 08:42PM PDT, ID: 21498042

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.04.2008 at 10:18PM PDT, ID: 21498229

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628