は最近、私は文書化されていないコマンドラインオプション-batchinput
と-batchoutput
の使用が示されているMathGroup上のいくつかのold postが見つかりました:Mathematicaでのバッチ入出力は?
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
をしかし、Windowsでこの現象を再現しようとしたとき、私は、コンソールウィンドウに印刷された第1出力のみを取得します。私は間違って何をしていますか?
おそらく '-script'オプション(8の新機能)が役に立ちます。それは同じことではありませんが、 'Out ='行は印刷されません。 – Szabolcs
@Szabolcsこのオプション(またはそのリンク)の使用例を挙げてください。 'Out ='ラベルは '-batchoutput'オプションでは表示されません。それと '-script'の違いは何ですか? –
@アレクシー、バージョン8はありますか? '-script'では、あなたのプログラムが何らかの明示的な出力をしない限り(例えば、' Print'を使用する)何も印刷されません。 "more info"を参照してください:http://reference.wolfram.com/mathematica/ref/program/MathKernel.html '' math -script file.m''を実行して 'スクリプト"。 – Szabolcs