Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have some code in a file named Demo-3.m, It can be evaluated in Mathematica 9. The final expression in the file is

Export[NotebookDirectory[] <> "fintempimg.jpg", fintempimg];

How can I execute Demo-3.m in Linux using the command-line? Please give me a solution with an example.

share|improve this question
4  
I think you can use script to do this, like math -script file.m. Here has very useful step by step detail. –  xslittlegrass Feb 25 '13 at 2:46
    
Oh my god!! thanks for @xslittlegrass solution, it can work :) –  user5990 Feb 25 '13 at 2:54

1 Answer 1

up vote 8 down vote accepted

As xslittlegrass posted in a comment to the question, the file Demo-3.m can be run on Linux by issuing

math -script Demo-3.m

at the command line.

More information on Mathematica scripting can be found here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.