The below line should provide an output date which when run manually gives an proper output such as Fri Jul 17 01:42:07 2015.
But when run using cron, it gives the epoch date i.e. Wed Dec 31 19:00:00 1969
job_date=`iwgetwfobj $i | sed -n 2p |tr -s '=' '@'|awk -F'@' '{print $6}'|tr - d \" |tr -d \>| perl -e 'print localtime(<>) . "\n";'`
Please let me know the change to be made. Any help will be appreciated.
| tee /tmp/lets-see.logjust before the| sedand see what's wrong with the second line of the output ofiwgetwfobjin/tmp/lets-see.log.TZ=US/Eastern perl -E 'say scalar localtime(0)'indicates you're getting epoch 0 somehow. In addition to theiwgetwfobjbit, what is$iand where did it come from?