I start a batch job using:
% cat commands.m
system ('gzip testfile') % qsub
touch testfile touch testfile.gz matlab -nodisplay < commands.m ^D your job 443354 ("STDIN") has been submitted
The MATLAB job makes a system call to gzip to compress "testfile". Because a file already exists with the same name as the compressed file ("testfile.gz"), gzip does one of two things:
1. With an interactive session (i.e., a pseudo-tty) attached to the process, the system asks the user if they wish to overwrite the file.
2. During a non-interactive session (i.e., the process has no attached pseudo-tty), gzip aborts without overwriting.
Best Answer