On 2013-01-10, Sean <seany at uni-bonn.de> wrote:
> I will play around with sregex package, btw, is there a
> way for Maxima to call external scripts (say perl), and
> get the output programetically, i.e. not by pipe symbol,
> which one uses in the command line manual call?
Someone else mentioned the 'system' function to execute external
programs. To capture the output (assuming it is to stdout), you can
create a string output stream:
(%i2) S : make_string_output_stream ();
(%o2) #<OUTPUT STRING-OUTPUT-STREAM>
(%i3) with_stdout (S, print (foo, bar), describe (make_transform),
printf(true, "blurf~%"));
(%o3) false
(%i4) S;
(%o4) #<OUTPUT STRING-OUTPUT-STREAM>
(%i6) S1 : get_output_stream_string(S);
=> <various stuff>
It appears that make_string_output_stream and get_output_stream_string
are undocumented; I guess that's an oversight. The code is in
share/stringproc/stringproc.lisp.
best
Robert Dodier