Piping output of a program to a scilab script
Mathieu Dubois
mathieu.dubois at limsi.fr
Fri May 4 12:39:48 CEST 2012
Hello,
I would like to know if it's possible to use scilab in a standard UNIX
pipeline.
I have some programs that output their results to stdout and I would
like to read it from scilab.
I know I can launch scilab in batch mode with "-nb -nwni" and execute a
command with-e.
I have tried to pass "exec(myscript.sci); myscript(); quit;" to scilab
where myscript contains something like this:
while ~meof(%io(1))
S = mgetl(%io(1));
// Process line
end
fprintf(0, 'Nothing more to read\n');
Unfortunately, scilab immediately prints "Nothing more to read" and quits.
Am I doing something wrong? Any idea?
Mathieu
P.S.: It's easy to check that meof(%io(1)) always returns 1. I guess
this is because standard input refers to the scilab command line (which
waits for input) and not to the process standard input.
More information about the users
mailing list