the follwing script is running fine , when run from the ksh shell...it runs properly i.e. waits for a file "test.flag" and sends mail accordingly.
But when I schedule it in the crontab ...it does not run at the specified time (it never runs).
I am using ksh
####shell script starts
count=1
while true; do
if test -f test.flag
then
mailx -s "File Found" s.ba@dsc.com s.ba@hcil.in </man/prd2/bat/tmp/found.txt
exit 0
fi
let count="$count + 1"
#####count=$(( $count + 1 ))
sleep 2
####wait (2)
if [ $count -gt 300 ]
then
mailx -s "File not Found" s.ba@dsc.com s.ba@hcil.in </man/prd2/bat/tmp/not_found.txt
exit 0
fi
done
####shell script ends
###ran crontab -l
20 11 * * * /sa/p/brd/tmp/mailer.sh
##### ran uname -X
System = SunOS
Node = ritba
Release = 5.8
KernelID = Generic_108528-24
Machine = sun4u
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 2
Please suggest, (the path of .txt files is correct)