Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 630
Alexey Popkov Avatar asked Jul 01 '11 00:07

Alexey Popkov


1 Answers

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.

like image 164
Dr. belisarius Avatar answered Nov 14 '22 21:11

Dr. belisarius