Re: How to run ".nb" file always in dos command line
- To: mathgroup at smc.vnet.net
- Subject: [mg123599] Re: How to run ".nb" file always in dos command line
- From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
- Date: Tue, 13 Dec 2011 05:38:18 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112121141.GAA12756@smc.vnet.net>
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.
>
- References:
- How to run ".nb" file always in dos command line
- From: wch <weichanghe2000@gmail.com>
- How to run ".nb" file always in dos command line