I have made a script which transfers some files of the entire week , but the script fails when the next month is started.
For e.g; if i run the script on 5th may , but i need to transfer files of its previous week which is from 24th April to 30th april ,the script fails, i have this loop in the script
dt_2=`TZ=CST+$dt date +%Y-%m-%d`
I just put values in $dt which gives me the date to which i need to transfer the files.
For e.g; Considering current date as 2011-05-05, i need to go to date 30th april onwards to 24th april then
24 * 5 = 120
`TZ=CST+120 date +%Y-%m-%d`
will give me date 2011-04-30.
But the problem here is i am not getting the correct count value,
since i have used cnt1=`expr $1 - $2` which is subtracting two date values , but this does not work for the e.g; which i mentioned above
Could you suggest me a solution on this.
Would appreciate your assistance.