I am creating the script below in cronjob. It is manually getting generated. But, when in cron, it is failing to generate the files.
Below is my unix cron script.
#!/usr/local/bin/bash
var=`perl -w -e '$d=1*86400;@t=localtime (time -$d); printf "%.2d%.2d%.2d", $t[5]+1900,$t[4]+1,$t[3];'`
var="`echo $var |cut -c3-8`"
i=1;
while [ $i -le 8 ]
do
cd /home/svfe/bin
./bills_unloader -d $var -f $i
i=`expr $i + 1`
done
echo "Done !
When I try to debug the script, I am finding below error.
/usr/lib/hpux64/dld.so: Unable to find library 'libclntsh.so.11.1'. /home/swa/swa2/autoload/bills_unloader.sh: line 19: 7078 Killed
./bills_unloader -d 170606 -f $i
Why is the command failing in cron, but working fine when executed manually?