Problem with executing a script scheduled in crontab

Hi

I have written a shell script(in Solaris) in which following logic is there.....

i=1
while read control
do
key[$i]=`echo $control | awk -F$DELIMITOR '{ print $1 }'`
echo "Key Values" ${key[i]}
i=`/usr/bin/expr $i + 1`
done < $CONFPATH/$CONFFILE

when i execute it at prompt it works fine...but when the same is scheduled in crontab it is giving errors like
/user1/asdf/source_code/listen_sch.sh: key[1]=PortNumber: not found
/user1/asdf/source_code/listen_sch.sh: bad substitution
/user1/asdf/source_code/listen_sch.sh: val[1]=2001: not found

any suggestions.....
Thanks

Try adding this as the first line in your script:

#!/usr/bin/ksh

Regards.

I am facing similar problem, tried but the solution didn't work. Pl help

Have u checked for permissions of scripts.....
and which sheel u are working in can u send the o/p u get while running script without crontab........
thks
Aparna

oye kudiye chal gia :slight_smile: