4

I have the following .m file

(* ::Package:: *)
(* ::Input:: *)
(*out=1+1;*)
(*Print["Test"];*)
(*Export["/path/test.txt",out];*)

and I am trying to run it in the terminal with math -run -nomprompt < name.m

but it doesn't work. I have changed the permissions of the .m file.

Rohit Namjoshi
  • 10,212
  • 6
  • 16
  • 67
hal
  • 783
  • 3
  • 14
  • 1
    It works for me when I uncomment the last 3 lines of the code, recognizing that -nomprompt contains a typo. – LouisB Apr 09 '20 at 19:26

1 Answers1

0

Solution: They have to be initialization cells to be able to run them.

hal
  • 783
  • 3
  • 14
  • 2
    They have to be initialization cells to not export as comments in the autogenerated .m file – b3m2a1 Apr 09 '20 at 22:20