I can't try it at the moment, but you might try to change the test script to
Code:
scriptdir=`/usr/bin/dirname $0`
cd $scriptdir
./test > output.log 2> error.log
This redirects output and error messages to log files which might point you into the right direction.