问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/6542537/batch-input-and-output-in-mathematica