Type the 'set' command at the prompt and put the ouput in the script. See if it runs successfully during it's next scheduled occurrance. If it does, then it is an environment variable (which is my guess). Most likely it is the LD_PATH (or similar) variable. You can start eliminating variables until you figure out which one is the critical one.
I exported the LD_LIBRARY_PATH environment variable in a shell script, and invoked the expect script from the same script. The shell script was scheduled as cron job. It worked!
But I am facing yet another problem in the expect script. I am calling 'mkpasswd' command(which, in turn, is an expect script) from my expect script.
set NEWPASSWD [exec mkpasswd -d 2 -l 6 -s 0 -C 0]
It says "mkpasswd not found". How else can I store the output of 'mkpasswd' command in a variable?