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

learn more… | top users | synonyms (1)

1
vote
0answers
37 views

Changing system shell

What I'd like to do is to have a Mathematica script use some user-defined bash functions before scheduling some calculations on the results generated by by these functions. Since I have them written ...
1
vote
1answer
67 views

Running an external simulation program from Mathematica

I have a physics simulation program which I run through a terminal window (I use a Mac) as shown below: user$ programName inputfile.ele I would like run a ...
1
vote
0answers
43 views

running the mathematica script in SQL Server

Hi i am trying to learn mathematica. I am following instruction in one of the questions asked before and did the following: In SQL Server a stored procedure is created as follows: ...
0
votes
0answers
26 views

How to get a script to print MaxMemoryUsed[] upon getting a system signal?

I want to instrument a Mathematica script so that, upon receiving any system signal (e.g. SIGINT, aka Ctrl-C) it will print1 the ...
1
vote
0answers
32 views

*Form is not working in script

I want to generate code with a script. But functions as CForm, FortranForm and TeXForm does ...
3
votes
1answer
52 views

How to prevent a standalone kernel from opening windows?

I am trying to make Mathematica do some plots for me as a part of a script. I have a .m file that basically does Import[] on ...
5
votes
1answer
106 views

UseFrontEnd is not working the same in version 10.4

I'm using batch files to run Mathematica notebooks (with saved output) but in version 10.4 the functionality has changed. Any ideas how to get it working? I use a batch file to run a .m script which ...
4
votes
2answers
207 views

Running Mathematica Notebook files in command mode

The question is, how can I run a .nb file in the kernel mode of Mathematica? I am not an expert in Mathematica, but one of our users who use this program says that ...
1
vote
0answers
43 views

mathematica example for parallel run

I want to run a parallel mathematica example via a PBS script. I am not expert in this application, instead as a system administrator, I have to be sure that users are able to submit parallel jobs to ...
0
votes
1answer
44 views

Use the same Mathematica Executable Script on Different Computers

The first line in a Mathematica executable script specifies the directory of WolframScript, e.g. #!/usr/local/bin/WolframScript -script Assume I want to run a ...
2
votes
1answer
101 views

Display line number/stack trace of error in script (i.e. batch mode / command line interface)

I am trying to set up a Mathematica script so that it runs from the command line in the manner that a sane person would expect. I have the following at the start of the file: ...
1
vote
1answer
39 views

How to print TeXForm running script?

I've got a simple script which runs in bash some code - I want now to get an answer in TeX Form. If I would run Mathematica code inside the interpreter, it would be easy: ...
3
votes
0answers
80 views

`ParallelTable` pending the MathKernel after execution

I have done a ParallelTable computation in script mode. After execution, the output is fine and I've got all the data I needed. but the kernel seems pending, ...
1
vote
2answers
102 views

How to set the relative directory so that they work both in script and in notebook and portable?

Maybe the question is not clear, here I try to state it in more detail´╝Ü I have a folder named project, for instance. In it I have two folders, one is named ...
1
vote
0answers
59 views

Random “silent” crash when running a math kernel in terminal for a long time

I sometimes use Mathematica to run very long calculations in the terminal (Debian). To do this I use the command: math -script (filename) Now after several hours ...
2
votes
1answer
73 views

NotebookEvaluate with InsertResults -> True from the command line

Suppose I have a notebook template.nb like this: and I want to evaluate this notebook from the command line. So I wrote this Mathematica script: ...
3
votes
0answers
56 views

How to “fake” a front-end object when running a Mathematica script? [duplicate]

I'm running a Mathematica script (content of which cannot be disclosed here) and some part of it requires "front-end"? Since it's running in a script, there is not one and it gave the following error: ...
1
vote
0answers
59 views

Running a script that needs a package

I am running a resource extensive notebook, and so I am trying to break it down into a .m file so that I can run it quicker and without using the mathematica interface. The problem is that my notebook ...
3
votes
1answer
116 views

kernel not running script

I'm on under OS X trying to run a script through the kernel. My actual plan is to run a bash script which would call mathematica with an address to process a file. I have finished the code (with ...
3
votes
1answer
153 views

Run mathematica scripts without initializing the kernel every time

There are two duplicate's of this question that seem to only work on linux/osx currently. So how can I viably run mathematica scripts without spawning a new session each time from command prompt? I ...
6
votes
1answer
135 views

When I run multiple Mathematica programs from terminal, are they supposed to use different Kernel?

Since I found that when I using notebook interface, I need to assign different kernels to different notebooks (if I want to run them at the same time), I wonder if I run those *.m files from terminal ...
3
votes
1answer
104 views

Analogue of NotebookDirectory[] for scripts (to get the directory path of my script.m)?

Is there a way to get the script directory from inside a Mathematica script? I want a function analogue to NotebookDirectory[] (which doesn't work for scripts). Is ...
5
votes
1answer
122 views

Wolfram Script Not Completing when ran as cron job

I have a fairly simple Wolfram script called from within a shell script that I would like to run at certain times. The shell script calls a python script to get some recordings to from GPIO and saves ...
5
votes
1answer
272 views

Executing Mathematica code via Notepad++

I wonder if there is a way to execute Mathematica code via Notepad++. After some searching on the web, I found that there is a user-defined language that supports Mathematica highlighting, but there ...
4
votes
1answer
135 views

Notebook vs. Kernel: Kernel giving inaccurate results

I am running a code on Mathematica (on Mac OS X) that takes high values for some of the variables. In Notebook, I set the global precision using the following code (which is well documented!) at the ...
1
vote
0answers
107 views

FrontEndObject::notavail: error when using math

I am new to mathematica script and thus I don't know whether this generated error is natural or not. When I write a command such as echo "3" | math in the terminal....
1
vote
1answer
93 views

Auto Execute Notebook on Open [duplicate]

How might I automatically execute a notebook script on open? For example I would like to a notebook to automatically execute it's cells.
4
votes
0answers
110 views

Lisp Interpreter

What is the cleanest way to build a lisp interpreter inside Mathematica. I'm not looking for all the functions to be implemented but instead just the basic syntax.
11
votes
3answers
611 views

Windows command line arguments, stdin & stdout

Is it possible to utilize all three: command line arguments, stdin, and stdout all at once in script for Windows? Unix is fairly easy, but I can't get the following to work with Windows. Using the ...
0
votes
0answers
219 views

Running math file as batch job

I am trying to run the following Mathematica program, ...
1
vote
1answer
145 views

Mathematica script file in Linux - how to export PDF file and close kernel?

tmp.m file: tmp = Table[RandomReal[], {3}, {4}] Export["test.xlsx", tmp] Quit[] Then ...
2
votes
2answers
215 views

How to stop a .sh script that calls multiple Mathematica scripts?

When I press Ctrl + C in a linux console running a Mathematica script, it doesn't stop. Instead it brings a console where I am supposed to type either quit, or <...
1
vote
1answer
174 views

Expecting an image or graphics instead of -Image-

Here's a snippet of my notebook. When run with the frontend, the code runs fine with no problem at all. However, when I save the notebook as .m file and run it using "Mathkernel -noprompt -script ...
4
votes
1answer
1k 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: ...
34
votes
1answer
989 views

math.exe vs wolfram.exe vs MathKernel.exe vs WolframKernel.exe (running scripts on Windows)

I generally consider Mma documentation very good. However, it is startlingly difficult to find useful information on running Mma batch scripts, especially on Windows. So ... just what would I enter ...
2
votes
0answers
115 views

Find where an error occurred in a bunch of command line scripts

I have been using my intuition to solve errors in my Mathematica scripts. But when calculations got more complex and I started getting errors involving code in more participating scripts (a script ...
1
vote
0answers
92 views

Needs entry point of a package from a Mathematica script

I am writing a bunch of Mathematica scripts to run command line in a HPC environment. I am organising my solution in small chunks I can test separately. So I have a directory structure like: ...
2
votes
0answers
114 views

Session logging of “\$Echo” and “\$Output” in Mathematica 10

I have difficulties with session logging and Mathematica 10. In previous versions, you could simply use AppendTo[$Echo, logfile] and ...
0
votes
1answer
230 views

Mathematica on a cluster

I try to run mathematica on a grid. Since this is my first time working on a cluster, I have no plan what to do. I have to run a job (pbs-file). ...
4
votes
1answer
330 views

Mathematica script - Using front end

I'm running Mathematica on OS X and I want to create an Automator action that converts spreadsheet files. I have written this script: ...
0
votes
1answer
329 views

How to record all the output (including error messages) of a mathematica script in a file?

Is it possible to record all the output of a Mathematica script to a file? I am looking for the Mathematica equivalent of ...
5
votes
1answer
2k views

Running a shell script within Mathematica

The title pretty much explains it and I have not found something similar already posted. Perhaps I am not searching for the correct title or maybe this is something very basic, but I would appreciate ...
1
vote
0answers
45 views

Sending a command to an already opened frontend

I'm trying to pipe low-level notebook commands to work through terminal and I've tried various ways, but I can't really get to the frontend that's already open. For example Opening a notebook from ...
2
votes
1answer
128 views

Multiple scripts run using same kernel

I have an external program that calls Mathematica scripts upon certain events. Each script requires a large Mathematica library to load (takes a while). Is there some way to run an initial script ...
1
vote
1answer
87 views

Write memory usage to file in script

Is there a way to write the MemoryInUse into a file once a minute? In this Debugging memory leaks question there is a neat dynamic diagram showing the MemoryInUse over time. My problem is that I run ...
6
votes
1answer
625 views

Mathematica scripting on Microsoft Windows

Is it possible to use Mathematica (or the Mathematica kernel) to interact with Microsoft Windows, much like any macro-based scripting language that controls the keyboard/mouse, opens/closes programs ...
4
votes
1answer
873 views

Wolfram language from batch or py

I would like to automate the commands in this website into a batch file, so when the batch file it runs these commands in sequence. http://community.wolfram.com/groups/-/m/t/157461 Do any of you have ...
12
votes
1answer
1k 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?
3
votes
1answer
174 views

How to start Mathematica kernel without loading init.m?

Is it possible to start Mathematica kernel from UNIX command line without having the init.m loaded, but not by simply deleting or commenting out it before hand? If this is a Mathematica script, is it ...
2
votes
1answer
390 views

Run kernel script in cygwin without window popping up

I'm calling mathematica scripts running kernels through a cygwin terminal, which are again executed from c++ code. When I do this a window pops up, prints warnings and errors if there are any, and ...