Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to automate the commands in this website into a batch file, so when the batch file it runs these commands in sequence.

Do any of you have any ideas. I know that you can just type in wolfram in a batch file like this:


It will give you this output:

Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information & help:


How would you enter commands in the In[1]:= from a batch script?

Thanks in advance. Ahmad

EDIT I think this could help from

wolfram -script file.wl 
share|improve this question… I've always used .m extension for mathematica scripts, .wl is new to me. – shrx Dec 28 '13 at 19:51
nice, i'll try it out now – Hamoudy Dec 28 '13 at 19:55
Have you tried this wolfram -script file.wl line that you suggest yourself? – Sjoerd C. de Vries Dec 28 '13 at 19:55
@shrx This is for the new version of Mathematica on the Raspberry Pi where many things with Mathematica-related names are renamed to match the new Wolfram Language name. – Sjoerd C. de Vries Dec 28 '13 at 19:57
Yes, I'm not sure how to format commands in the file, e.g. if I wanted 1+1, what would I do. I have tried just putting 1+1 and saving the file as test.wl, but nothing is output in the command window. BTW, this is for the PI. – Hamoudy Dec 28 '13 at 19:59
up vote 6 down vote accepted

Here is a minimal example on how to run a mathematica script on a raspberry pi. Create a simple script (I used my bash terminal to do it):

echo "sum=1+1; Print[sum]" > test.wl

Excecute the script:

wolfram -script test.wl


share|improve this answer
Thanks alot!!!! – Hamoudy Dec 28 '13 at 20:10

Your Answer


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.