For questions about MathematicaScript, or running the kernel without direct user interaction.

learn more… | top users | synonyms

3
votes
3answers
289 views

Temporarily redirect the output of Print[ ] to a second file

I have started using Mathematica to automate file backup operations. The logistics I need make Mathematica a good choice. I am testing and developing the Notebook manually, and ...
14
votes
3answers
812 views

Reading from STDIN, or: how to pipe data into Mathematica

Today I tried using Mathematica's plotting capabilities to display the output of a C++ program. This made me wonder whether it is possible to somehow tell a Mathematica script to read from STDIN and ...
10
votes
1answer
518 views

Scheduling Mathematica scripts to run from a command line [duplicate]

I want to run Mathematica "jobs" on a daily/weekly basis to do system maintenance and as part of daily processing operations. What is the best way to do this?
10
votes
2answers
2k views

Printing a string in a Mathematica script

Here's a simple script saved in the file hello #!/usr/local/bin/MathematicaScript -script Print["Hello world"] I can then run ...
3
votes
2answers
575 views

How to create an executable notebook in Mac OS X

All, I am looking for help to create a notebook to be executed via terminal in MAC OSX. The notebook uses the front end. This is what I have so far ...
3
votes
1answer
411 views

Interrupting package evaluation, handling error

I have some packages/scripts that I schedule the execution using Jobs in SQL server. For example, in some of then, I use to create reports and delivery by mail using Mathematica. All done using ...
7
votes
1answer
384 views

Launch a specific notebook automatically when Mathematica starts

I run Mathematica on an iMac running OS X 10.6.8. I have set the OS's "Launch Items" to include Mathematica so that the application opens when the computer boots. Now I want to go further and ...
15
votes
1answer
612 views

Why are all the lines commented when I create a Mathematica script?

When I created a Mathematica script, I found that all my lines were commented out (when opened with vi or gedit or any other ...
4
votes
2answers
1k views

Command line execution of Mathematica notebooks and conversion to .m

Sometimes one may want to execute a notebook via the command line (for example to run it remotely). As far as I know it's not possible to run notebooks directly, but ...
4
votes
2answers
198 views

Why does Mathematica stop when run in the background in command line mode?

If I try to start a Mathematica script in the background from the command line, like this: math -script someFile.m & then the process gets automatically ...
4
votes
1answer
132 views

Saving a source file adds (* ::Package:: *) to the first line

I am running Mathematica 9 on a linux machine and I've encountered the following behaviour that I am trying to understand. When I'm editing multiple source (.m) files using mathematica saving adds a ...
2
votes
1answer
82 views

Proper way to run a Mathematica script (-script vs -run vs MathematicaScript vs <)?

Suppose I have a Mathematica script called test.m. There at least 4 ways to run this from the terminal: ...
0
votes
1answer
359 views

StringJoin/FileNameJoin doesn't quite work in script

My mathematica script is as follows: ...