I am having problems running this script from cron. If I run it standalone I do not have any issues.
I get an error that says "let cannot be found"
Thanks for any help
Code:
#!/bin/ksh
log_file=job_run.log
tail -1 $log_file | read l_year l_dayofyear l_restofit
cd /usr/users/twigguy
date +"%Y %j" | read t_year t_dayofyear
let "day_laped=($t_year - $l_year) * 365 + $t_dayofyear - $l_dayofyear"
echo $l_year $l_dayofyear $t_year $t_dayofyear $day_laped > gpg.log
echo "start"
if [[ $day_laped -gt 12 ]]
then
cd /usr/users/twigguy
/usr/users/twigguy/thruwaygpg.sh 1> /usr/users/twigguy/gpg.log 2> /usr/users/twigguy/gpgsys.log
date +"%Y %j %m %d %a %H:%M" >> $log_file
mailx -s "Log Data" pgp_report < gpg.log
else
echo do nothing >> gpg.log
echo "finish"
fi
I get an error that says "let cannot be found"
Thanks for any help