echo "matlab -nojvm -nodisplay -nosplash -r \"warning off, delete('result.txt'), warning on, diary('result.txt'), try, run 'main.m', catch e,disp(getReport(e)), end, exit\" ; echo 'Test Result' | mail -s 'testing' -A result.txt email@gmail.com" | batch