Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: command line question

  • To: mathgroup at
  • Subject: [mg65888] Re: [mg65874] command line question
  • From: "David Annetts" <davidannetts at>
  • Date: Fri, 21 Apr 2006 01:33:23 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Hi Jason,

> Hi, I'm trying to execute Mathematica (5.2 on Windows) from 
> the command line via another program, but I'm having a hard 
> time finding a way that would just run a command, then exit.  
> Can this be done?
> Even if I could just read my argument from a file and write 
> it to another would be fine...just as long as it gives the 
> result, the exits.

It works ....

Open your favourite editor & type a whole series of commands.  Then run
Mathematica using

	math < inputFile.m > outputFile.out

For example, if test.m contains the two lines
	plt = Plot[x^2, {x, -2, 2}, DisplayFunction->Identity,
	Export["test.eps", plt, "EPS"];

Then we can run the file from the command line using 

	math < test.m > test.out

And produce the files test.out & test.eps which contains the plot we
produced from the command line run.



  • Prev by Date: Problem connecting to ODBC database
  • Next by Date: Re: NDSolve with implicit function
  • Previous by thread: Re: command line question
  • Next by thread: NDSolve with implicit function