MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica 6.0 math.exe question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79440] Re: Mathematica 6.0 math.exe question
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 27 Jul 2007 05:41:44 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f89q8u$5pq$1@smc.vnet.net>

Yvon wrote:
> I am trying to run math.exe with a .m file in Windows XP.
> 
> The testAuto.m file has the following:
> 
> Integrate[Exp[I\[Pi]x],x]
> Plot[Sin[x+Sqrt[2]Sin[x]],{x,0,2\[Pi]}];
> Export["c:\\pods\\testOut.gif",%]
> Quit[]
> 
> In the command prompt, I type        math.exe -run testAuto.m
> 
> It returns with In[1]:=  waiting for me to enter something.
> 
> The testAuto.m file is in the same directory as the math.exe program
> (under C:\Program Files\Wolfram Research\Mathematica\6.0)
> 
> It's as if it is not recognizing or reading the .m file.  Is the file
> not in the correct format?  I originally wrote a notebook in the GUI
> and did a Save As... file type package (*.m).  The resulting file in a
> text editor showed that all the lines were converted to comments (*
> *), so I deleted all the lines and symbols leaving only the actual
> input commands and resaved.  I did this after trying the above command
> line with the original .m output and received the same result.
> 
> Please help me figure out how to run this from the command prompt.  I
> would like to write some "routines" in Mathematica to schedule
> automatically to run overnight using the Windows scheduler.
> 
> Thanks in advance!
> Yvon

Follow precisely the directions given in the FAQ titled, "How do I run 
Mathematica for Windows in batch mode?" available at 
http://support.wolfram.com/mathematica/systems/windows/general/winbatchmode.html

I did some test that worked perfectly. First I created the following 
file in the directory where resides the kernel,

--------------------------------------- beginning of the file testAuto.m
AppendTo[$Echo, "stdout"]
Integrate[Exp[I\[Pi]x],x]
Plot[Sin[x+Sqrt[2]Sin[x]],{x,0,2\[Pi]}];
Export["testOut.gif",%]
Quit[];

--------------------------------------- end of the file testAuto.m

then, called the the text mode interface with
'math < autoTest.m > output.txt' (without the single quote)

and I got a file called testOut.gif in the current directory.

Regards,
Jean-Marc


  • Prev by Date: Love and Tensor Algebra
  • Next by Date: Re: Re: Searching list for closest match to p
  • Previous by thread: Re: Mathematica 6.0 math.exe question
  • Next by thread: loading Units package from a Button in 6.0