Originally posted by: Wouter Liefting
You'd have to post the script itself for me to be certain, but from your output it looks like the script is run when there is no Detail_Err* or Data_Err* file. The shell itself therefore cannot expand those wildcards, and the original name, with the wildcard, is passed to another program, possibly the e-mail program itself. That program does not do wildcard expansion but tries to attach the original name (with the wildcards in it), and that file does not exist. Hence the error.
In other words, you have not written your script correctly, to handle the fact that the file you're looking for is not there.
One possible related cause: When executing from cron, the context (mostly your environment variables) is not setup in the same way as an interactive login session. You can't necessarily rely on your active working directory to be the same, $PATH to be the same, and a few other things. If you rely on $PATH, $LANG or any other shell variables, or if you rely on the script being executed in a particular directory, make sure you set these variables and environmental factors yourself.
BTW the 777 permissions means that anyone on the system can alter your script. It's pretty likely that that's not the intention. 755 or 700 would probably be more appropriate.
#AIX-Forum