SCRIPT IN SAP

Hi all,
I have written one script. it is working fine. But when I am going to run this script through SAP in sm37 job it is giving error.

Ext. prog.: Can't exec external program (Exec format error)
Ext. prog.: External program terminated with exit code 1
Ext. prog.: SAPXPG started on cpcsaps2_RS2_35, Process ID 22001, Process Number 12
External program was cancelled
Job cancelled
#!/bin/ksh
print '================================================'>> log_core
delcnt=0
delcnt_old=0

for files in `find ./ -name core_test -mtime -5 -type f -print`

do

echo " $files Deleted : " `date +%Y-%m-%d.%Hh%Mm%Ss`\n >> log_core
delcnt=$(($delcnt + 1))
/bin/rm $files
done
for oldfiles in `find /usr/sap/RS2/DVEBMGS35 -name core_test_old -mtime -5 -type
f -print`
do
echo " $oldfiles moved to : /usr/sap/RS2/core_old \n">>log_core
delcnt_old=$(($delcnt_old + 1))
/usr/bin/mv $oldfiles /usr/sap/RS2/core_old
done
echo "deleted $delcnt files">> log_core
echo "$delcnt_old files moved ">> log_core
#this is for mail text
curmth=`date +%m`
set -A mth Dec Jan Feb March April May June July August Sept Oct Nov Dec
prevmth=${mth[$((curmth + 1))]}
season1='Hi,\n The two month old below files moved to the new location.'
season2='Kindly have a look on them.these files will be automaticaly deleted onw
1st'
#mail text end
echo "${season1} ${season2} $prevmth \n">>log_core
print '====================End==========================='>> log_core
if [[ $delcnt -ne 0 || $delcnt_old -ne 0 ]];
then
cat /usr/sap/RS2/email_list | while read emails
do
echo $emails
mailx -r alert -s "Core Deletion" $emails<log_core && mailq
echo Mail Sent Successfully
done
fi
rm log_core