Suppose we want to integrate e**x in linux command line and every time the integration range may vary.We can call the integration script and input the specified integration range every time in command line.
I have read http://reference.wolfram.com/mathematica/tutorial/MathematicaScripts.html,but it is sort of terse.
Q1
Is it a .m script necessarily?
Q2
Could it be a nb file?Then the formula could be written easily.
Asked
Active
Viewed 2,518 times
1

questionhang
- 735
- 2
- 12
- 31
1 Answers
4
for something this simple you dont even need a script:
echo "Integrate[Exp[x],{x,0,y}]" | math
If you want to batch execute notebooks you will need to create a wrapper .m script that opens and evaluates the notebook -- Way overkill for this problem but see here:
mathematica start front end and eval notebook from command line
-
1Thanks.echo "Integrate[Exp[x],{x,0,y}]" | math -noprompt could give a pure result. – questionhang Sep 27 '13 at 13:39