PFB script
dd=$(perl -e 'use POSIX;print strftime "%Y%m%d",localtime time-172800;')
Date=$(perl -e 'use POSIX;print strftime "%d%m%Y",localtime time-172800;')
for i in `cat /path/Path_CDR.txt`
do
cd $i
compress event*$dd*.asn
compress event*$dd*.CDR
zcat event*$dd* |grep Event |awk -F "," '{print $14,$16}'|awk -F '"' '{print $2","$4","'$Date'}' >>/path/abc$Date.txt
done
Output1: Script run manually using sh -x (script name) output comes in as per below format(Coorect)
07923243305,14,4112019
07923241717,44,4112019
07923224727,33,4112019
07923241717,10,4112019
while schedule on crontab the output comes in below format only date format issue(date issue 4.11202e+06)
07923243305,14,4.11202e+06
07923241717,44,4.11202e+06
07923224727,33,4.11202e+06
07923241717,10,4.11202e+06
Kindly help me with this