Issue with cron job -Please help

Hi ,

I have an issue with cron job that i have scheduled today. The problem is that when i run this script in command prompt it work good giving me the desired results but if i schedule this to run using cron job it failes giving a "syntax error in line 11 :$"..... Can anyone look into this and let me what to do.....Basically the script works to find a charater in the very first line of a records which is about 10000 lines and gives me an output if the charater is there or not. PLease ...please some one help me out

THis is the script that i am using:

FROM_DIR=/home/sandy_home/cc3; export FROM_DIR
LOG_DIR=/home/sandy_home/log_dir; export LOG_DIR

echo "NUMBER OF cc3 files BEFORE process STARTS-IF A FILE IS MISSING/NOT TRANSFERRED CONTACT Sandeep" > $LOG_DIR/che
ckfile.log

cd $FROM_DIR

ls -l .cc3 >> $LOG_DIR/checkfile.log
for ccfile in $FROM_DIR/
.cc3

do
line=$(head -1 $ccfile)
if [[ $line = *ID* ]];
then
echo "----------------------------FOUND ID in $ccfile------------------------------" >> $LOG_DIR/checkfile.log
else
echo "---------------------------- ID NOT FOUND in $ccfile--------------------------" >> $LOG_DIR/checkfile.log

mv $ccfile /home/sandy_home/failed

echo "-----------The file that had no ID has been moved to failed directory---" >> $LOG_DIR/checkfile.log
fi;
done

You should specify which shell you want your cron job to use.
It is likely running sh and your interactive shell is ksk or bash.
add
#!/bin/ksh
as the first line of your script.

Thanks for the response. Actually i have not pasted that in this mail but i have that in the script but still this fails

Which is line eleven?

line=$(head -1 $ccfile)

Try:
line=`head -1 $ccfile`

Thanks for the help, I tried this and it worked:

strline=`head -1 $ccfile | cut -c1-10`
if [ "$strline" = "$sandeep_TXT" ]

and exported sandeep_TXT in in the script:

sandeep_TXT="ID"; export sandeep_TXT

Thanks again for ur help:)