I have an issue regarding searching for old dates.
At the moment I search a field within a file for the last 3 days from the system date:
using today as 25/02/2010
DD=$(expr `date +%d` - 1)
DD1=$(expr `date +%d` - 2)
DD2=$(expr `date +%d` - 3)
MTH=`date +"%m"`
YR=`date +"%Y"`
DATE="$DD/$MTH/$YR"
DATE1="$DD1/$MTH/$YR"
DATE2="$DD2/$MTH/$YR"
this will get me records that have a field:
24/02/2010
23/02/2010
22/02/2010
I run this everyday how can can i get the last 3 days if it is between months:
the date is 01/03/2010
How can i get the following records with:
28/02/2010
27/02/2010
26/02/2010
any help would be appreciated