1

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.

questionhang
  • 735
  • 2
  • 12
  • 31

1 Answers1

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

Community
  • 1
  • 1
agentp
  • 6,849
  • 2
  • 19
  • 37