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
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!


WolframScript– ktm Mar 11 '19 at 03:46Dummy.mand see if code lines have been commented out(* like this *). – J. M.'s missing motivation Mar 11 '19 at 06:10