# Wolfram language from batch or py

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)
Information & help: wolfram.com/raspi

In[1]:=


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

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

wolfram -script file.wl

-
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

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

-
Thanks alot!!!! – Hamoudy Dec 28 '13 at 20:10