Re: command line question

*To*: mathgroup at smc.vnet.net*Subject*: [mg65888] Re: [mg65874] command line question*From*: "David Annetts" <davidannetts at aapt.net.au>*Date*: Fri, 21 Apr 2006 01:33:23 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

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, ImageSize->512]; 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. Regards, Dave.