Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7156

Re: How to run ".nb" file always in dos command line

From Patrick Scheibe <pscheibe@trm.uni-leipzig.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How to run ".nb" file always in dos command line
Date 2011-12-13 10:39 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jc7a06$ojk$1@smc.vnet.net> (permalink)
References <201112121141.GAA12756@smc.vnet.net>

Show all headers | View raw


Hi,

please go to Help->DocumentationCenter and paste

tutorial/MathematicaScripts

into the search line. You'll see that a file test.m containing this:

#!/usr/local/bin/MathematicaScript -script
Export["./test.png",Plot[Sin[x] ,{x, 0, 6 Pi}]];

will do what you want, when you set the file executable and call it like
a normal shell script with "./test.m" or you call

MathematicaScript -script test.m

If you are not on Linux, then you may have to adjust your paths, etc.

Cheers
Patrick


On Mon, 2011-12-12 at 06:41 -0500, wch wrote:
> Hi,everybody,I have met an problem when run mathematica in DOS
> interface. I will tell you this confuse:
> in "1.nb" file, I have written a sentence: Plot[Sin[x], {x, 0, 6 Pi}],
> then I run 1.nb in DOS command line with "> 1.nb", it will be opened
> in a moment.
> now I want to evaluate "1.nb" in DOS in order to generate the figure
> of Plot[Sin[x], {x, 0, 6 Pi}]. but I don't know how to send order to
> mathematica.
> In a word, I want to execute all process in DOS command not under
> notebook interface through "shift + enter". combination.
> Thank you for all the information in advance,I am wating for your
> coming.
> 


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: How to run ".nb" file always in dos command line Patrick Scheibe <pscheibe@trm.uni-leipzig.de> - 2011-12-13 10:39 +0000

csiph-web