# Run .m file in terminal

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.

• It works for me when I uncomment the last 3 lines of the code, recognizing that -nomprompt contains a typo. – LouisB Apr 9 '20 at 19:26