Hi,
In the code below, the $DD1, $DD2, $MM1, $MM2 are not fetching the values. Can anybody tell me where have i made wrong.
Shift_date.sh is a script which gives the previous date if we give the current date in the format YYYYMMDD and +/- how many days past/future.. Like Shift_date.sh 20080531 -2 gives an output as 20080529.
At last echo $DD1 is giving the correct value. But i need to get that in Pockets_$MM1-$DD1_to_$MM2-$DD2_data.txt..
Is it because of meta characters being used? Please Help..
#!/bin/ksh
currweekday=`date '+%u'`
currdate=`date '+%Y%m%d'`
((n1 = currweekday + 7))
((n2 = currweekday + 1))
DD1=$(ksh Shift_date.sh $currdate -$n1 | cut -c7-8)
MM1=$(ksh Shift_date.sh $currdate -$n1 | cut -c5-6)
DD2=$(ksh Shift_date.sh $currdate -$n2 | cut -c7-8)
MM2=$(ksh Shift_date.sh $currdate -$n2 | cut -c5-6)
echo Pockets_$MM1-$DD1_to_$MM2-$DD2_data.txt
echo $DD1
Thanks,
RRVARMA