Batch input and output in Mathematica?

Recently I found some old post on MathGroup where usage of undocumented command-line options -batchinput and -batchoutput is shown:

 If test.mma contains the following commands:

    a=2+2
    b=10!;
    a+b

 then, running Mathematica in batch mode, only output for the first and 
 third commands goes to stdout:

    # math -batchinput -batchoutput < test.mma

    4

    3628804

But when trying to reproduce this behavior under Windows I get only first output printed in the console window. What am I doing wrong?


I tested it and got both numbers as output. HOWEVER , if the last command is not followed by a carriage return, the output is exactly what you posted!

So, please check that you are ending your last line with a carriage return.

链接地址: http://www.djcxy.com/p/35532.html

上一篇: Mathematica Kernel和FrontEnd的在线参数

下一篇: Mathematica中的批量输入和输出?