0

I've created this Dummy.nb file with the code

x=2
x+3

and exported it as Dummy.m. Whenever I try to run it on the command line with math -run Dummy.m or math -script Dummy.m, a local interactive Mathematica kernel starts up, which is not what I want. It generates this output

Terminal Output

Ideally, I would want to run a notebook on the command line, and have the output evaluated for each cell, but my reading of this stack exchange makes me think that this is unlikely. I know this is a basic question, but how do I run my Mathematica code on the kernel properly.

Thank you for answering!

Pineapple
  • 111
  • 4

1 Answers1

1

Try saving your commands in a text file, then piping it to math.exe:

more dummy.txt | math.exe

enter image description here

MelaGo
  • 8,586
  • 1
  • 11
  • 24