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 would like to automate the commands in this website into a batch file, so when the batch file it runs these commands in sequence. http://community.wolfram.com/groups/-/m/t/157461

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

#!/bin/bash
wolfram

It will give you this output:

Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information & help: wolfram.com/raspi

In[1]:=

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

Thanks in advance. Ahmad

EDIT I think this could help from http://reference.wolfram.com/language/guide/RaspberryPi.html

wolfram -script file.wl 
share|improve this question
    
reference.wolfram.com/mathematica/tutorial/… 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
show 3 more comments

1 Answer

up vote 5 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

2

share|improve this answer
    
Thanks alot!!!! –  Hamoudy Dec 28 '13 at 20:10
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.