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.

My question is so trivial and I'm sure most people in here know exactly how to do this, however I still don't know how to run Mathematica in Mac terminal!

I need to use all the cores of my computer in order to get faster results. I open Mathematica in terminal using this command:

/Applications/Mathematica.app/Contents/MacOS/MathKernel

Then when I type math -run "<<test.m" (test is my file's name), nothing happens! Can anybody guide me what to do or refer me to a good refrence with some examples at this?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

With a test.m file content of :

Print["Hello World"];

At the kernel:

In[1]:=<<"test.m"                
Hello World

In[2]:=    

Or, as an alternative run the file as a script

./MathKernel -script test.m 
share|improve this answer
add comment

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.