I ran into something similar to this with MATLAB, where MATLAB would run over both 1 and 2 with whatever it felt like, so I wrote a wrapper that inserted a MATLAB command to open
/proc/self/fd/3, then redirected 3 on the command-line. I gave it a name like
script_out, and in the script I sent output there instead of standard output. This isn't MEL, but it should be obvious the correlation:
Code:
% prepended to the script:
script_out = fopen('/proc/self/fd/3', 'a');
When running the script:
Code:
matlab (some stuff to trick it into running a script) 3>&1 1>&2
In the body of the script:
Code:
fprintf(script_out, '%s\n', row_data(1:length(row_data)-1));
MATLAB doesn't recognize pre-opened file descriptors other than 1 and 2, but maybe Maya will let you use 3 without going through
/proc.
Kevin Barry