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