Check a condition in cronjob to execute a sh file

Hi,
I need to execute a crontab based on a condition where one SH file should be executed only based on the output of a file in a folder.

I have written the following cron job which is not working.

 
00 01 * * * read a < /px/batch/reslut.txt && [ $a -eq 1 ] && sh /px/batch/check.sh

where my reslut.txt file will have the value as a=1.

regards
Prashanth

why not call a script and check the value and execute the script

a=`cat /px/batch/reslut.txt`

if [ $a eq 1 ] ; then
               echo "executing script"
               sh /px/batch/check.sh

       else
               echo "No need to execute simply exit"
       fi

and in cron add that script
0 0 * * * your path

Hi Amitranjansahu,
Thanks a lot. That works.

regards
Prashanth