20
votes
Running Mathematica Notebook files in command mode
It is not a good idea to try to run a notebook in command line mode. Whether or not it is possible, it is just not a good idea because notebooks can only be handled by the Front End, which is not a ...
17
votes
How to reproduce Wolfram Language's base64 encoded string with command-line tool?
When you use the "Base64" you are encoding a particular file format. For Export calls the file format is inferred from the file name given, like ...
14
votes
Difference between "wolframscript -f" and "wolframscript -script"
The -script mode is an interface to the wolfram.exe's -script mode, which is a command-line version of Get. It essentially rewrites the command line, launches a kernel using the equivalent command, ...
12
votes
Accepted
10
votes
Accepted
How to view an image from command line?
Might be relevant, but this is something I use that uses StartProcess and ProcessConnection.
...
10
votes
Accepted
Any ergonomic tools for the command line kernel?
As I said in my comments, it is hard to implement this correctly if you aim for some advanced Dynamic features that work in the command line. However, you can ...
9
votes
Accepted
Evaluating a notebook programmatically with -ne
Update
a very simple solution to the OP has been given in this very duplicate post: all the outputs (in particular graphics) are then correctly inserted in the evaluated notebook without the need to ...
9
votes
Accepted
How to use shell commands inside mathematica
this works for me under linux:
SetDirectory[StringDrop[RunProcess["pwd","StandardOutput"],-1]]
( StringDrop drops a trailing ...
8
votes
Accepted
curl in Mathematica, google link-shortener
Many URL* functions overlap with functionality so there there are many ways.
Here is an example which returns a list of rules:
...

Kuba♦
- 136k
8
votes
Running Mathematica Notebook files in command mode
To replicate the Ctrl+A Enter execution behaviour automatically you can run Solve.nb from a package file, say runSolve.m, containing the code below.
While Wolfram Language Scripts are straightforward,...
8
votes
Accepted
How to activate Mathematica through remote license server from command line?
I believe the easiest way is to just edit the mathpass file to contain a line that has !server, where ...
8
votes
Accepted
Run retrieving stdout without using RunProcess
If you prepend bash -c to your RunProcess command, you can pass ls -ltr | tail -1 as a ...
8
votes
Importing Packages to .wls without shadow definitions and context specification
Here's a version of the script that works:
#!/usr/bin/env wolframscript -print All -run \'Needs[\"ComputerArithmetic`\"]\'
Ulp[1000.]
This is a limitation of <...
8
votes
what's the Mathematica command for a recursive formula?
This can be solves as a recurrence. If you subtract an appropriate multiple of f[n-1] from f[n] then ther result of that is ...
7
votes
Accepted
Determine how Mathematica was started
This question is more complicated that you might expect.
Things you can check:
Given how you want to use this, the simplest thing may be to just check if ...
7
votes
Accepted
Can we make preread replacements in an *.m* file before being run?
No. In fact, even $PreRead is ignored when reading .m files.
What you can do is define a myGet as
...
7
votes
Accepted
How to deal with compound command lines with RunProcess?
RunProcess does not run shell commands (things you might type into your terminal). It runs processes, as the name suggests.
If you want to run shell commands, then ...
7
votes
Can I run terminal commands such as SFTP/SSH through a mathematica notebook?
You can use CopyFile with a RemoteFile parameter, including the necessary Authentication ...
6
votes
How to view an image from command line?
As long you've set X11 forwarding correctly JavaGraphics should work just fine. I.e, ssh -Y remote followed by
...
6
votes
Textual progress in console?
Here is a crude progress bar demo script that has been tested in a Gnome terminal under Linux and a Powershell command prompt under Windows 10. Don't expect much because it's only a loop with a print ...
6
votes
Accepted
How to recover WolframScript's former `-run` functionality?
This is an execution mode I don't think we encountered in internal testing for the new wolframscript, the thought being that such processing would occur early in the script, an any needed values would ...
6
votes
Accepted
Problem calling Python scripts from Mathematica
To make the path permanently available to Mathematica (frontend) and all other applications, first find out the location of your desired python3 executable (e.g. ...
6
votes
Accepted
Can we make new definitions for InputForm in packages?
Unfortunately, I don't think there is. The association between characters and symbol names is burned into the kernel (in the form of a "yacc" grammar), with complete information about associativity, ...
6
votes
Accepted
FindRoot fails 100 iteration precision
You can ask Mathematica if it can tell you something about your function and in particular if it is going to be negative somewhere
...
6
votes
Any ergonomic tools for the command line kernel?
I have implemented a relatively bare-bones textual frontend for Mathematica called MathLine. It offers Readline-like text input (uses linenoise), which means command history and emacs-style editing. ...
6
votes
Accepted
Creating flags to use with wolframscript?
I suspect you have to write a script (in Unix/Linux/OSX style) that uses wolframscript as the shell in order to be able to process arbitrary flags from the command ...
6
votes
Accepted
6
votes
Accepted
what's the Mathematica command for a recursive formula?
I would define
f[0] = 1;
f[n_ /; n >= 1] := f[n] = Sum[f[i]/i!, {i, 0, n - 1}]
This uses memoisation, which is not strictly necessary, but avoids unnecessary ...
5
votes
Linux’s Bash shell in Windows 10 and mathematica
As we also know from a number of sources, bash-over-windows-10 is in beta, not yet feature complete, and it is not really meant to interface with Windows apps at the moment. If you can get a command ...
5
votes
Accepted
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
command-line × 136scripting × 39
windows × 11
kernel × 9
interoperability × 9
linux × 8
output × 6
export × 5
notebooks × 5
run × 5
graphics × 4
output-formatting × 4
customization × 4
parsing × 4
unix × 4
plotting × 3
front-end × 3
summation × 3
packages × 3
keyboard × 3
mac-os-x × 3
external-calls × 3
interface × 3
coding-style × 3
character-encoding × 3