1754328 Members
2750 Online
108813 Solutions
New Discussion юеВ

DATE - 1

 
SOLVED
Go to solution
Daniel Ubeda
Frequent Advisor

DATE - 1

Hi,

I need to rest 1 to the actual date.
ie

I have to run a process with two parameters:
the actual date and the yesterday date.
How can I to obtain the yestarday date ??

thanks
Daniel
4 REPLIES 4
Pete Randall
Outstanding Contributor
RAC_1
Honored Contributor
Solution

Re: DATE - 1

YESTERDAY=$(TZ=$(date +%Z)+24; date '+%b %e')
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor

Re: DATE - 1

The TZ method may or may not work depending on your local TZ setting but this method will always work:

YESTERDAY=$(caljd.sh -S "/" $(caljd.sh -p 1))

Invoke caljd.sh -u for full usage and examples.

You should have no trouble finding a copy of caljd.sh on the Forums but look for Versnion 2.1; it's the latest.
If it ain't broke, I can fix that.
Daniel Ubeda
Frequent Advisor

Re: DATE - 1

Thanks to all
and sorry for my very very bad english.

bye
Daniel