Questions tagged [command-line]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
24
votes
2answers
1k views

How do I efficiently navigate the command line interface to Mathematica?

I would like to perfom such feats as cycling through previous commands, editing commands in place, etc. My expectation would be a readline-like interface, but this appears to not be the default.
17
votes
3answers
8k 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: ...
17
votes
1answer
1k views

Difference between “wolframscript -f” and “wolframscript -script”

In Mathematica 11, there is new wolframscript.exe According to help wolframscript.exe -h -f [ -file ] arg---------Run a ...
15
votes
4answers
1k views

How to trigger UNIX command-line command from Mathematica notebook?

At UNIX command line, one can run ls -la $HOME. How to trigger this from Mathematica notebooks? Run["!ls -la $HOME"] ...
15
votes
1answer
866 views

Evaluating a notebook programmatically with -ne

I am running Mathematica 10.2 on an Ubuntu workstation. I would like to be able to evaluate a notebook through the command line, and save its final state so that I can launch evaluation remotely ...
14
votes
2answers
10k 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 ...
10
votes
2answers
196 views

Any ergonomic tools for the command line kernel?

Mathematica on the command-line (invoked by running 'wolfram' on bash shell) seems bereft of all modern usability features. I'd like a list of the best third-party packages available (if any exist) ...
9
votes
2answers
2k views

shortcut key for traverse command history in a Mathematica session in a terminal?

I wonder what is the shortcut key for traverse command history (i.e. retrieve last, last last, ..., commands) in a Mathematica session in a terminal? If I hit the up/down arrow or pageup/pagedown, it ...
9
votes
1answer
126 views

Importing Packages to .wls without shadow definitions and context specification

I am trying to import a package that works correctly when I use it in a notebook in a wolframscript .wls. I get a weird shadowing problem, however. Here is a minimal working example ...
9
votes
1answer
167 views

Textual progress in console?

Is there any way to get a textual progress bar (e.g. like the progressbar module in a python repl) when working in console mode? Anything would be better than this:
8
votes
3answers
610 views

Keep kernel running for execution of scheduled task

How can I keep a kernel running until all scheduled tasks have completed? For example upon running the following script bazinga.m: ...
7
votes
2answers
627 views

How to view an image from command line?

I'm running mathematica in command line mode, but I need to view a graph/image, so I'd like to open an image with an X11 window to inspect an image: Is there an easy way or built-in command to to ...
7
votes
1answer
379 views

curl in Mathematica, google link-shortener

I want to automatically get short links equivalents for things I CloudDeploy. I'd appreciate some tips on integrating command line workflow below into Mathematica ...
7
votes
1answer
140 views

How to deal with compound command lines with RunProcess?

Given Windows DOS command input: tasklist|find /i "explorer.exe" How to pass it to ...
7
votes
1answer
1k views

How to send OUT output to stdout when running a script from command line on widows?

I am learning how to run a Mathematica m file from command line. I am on windows. My question is: How to make the output display on the screen (the DOS windows) as the script is running? Currently, ...
7
votes
1answer
289 views

Determine how Mathematica was started

I have a notebook that I also execute as a m file on the command line. Depending on whether I run the notebook or the m file, I want to use slightly different commands. For example, ...
7
votes
1answer
227 views

Completion in terminal?

I know that it is possible to run Mathematica in Terminal. But I didn't find a way to get completion work in Terminal. I mean completion by ...
7
votes
1answer
562 views

WolframScript Unix - Script Parameters on Raspberry Pi

I'm currently trying to run a script with 2 parameters which gets called via a BASH script. The script runs fine however the list of passed parameters , ...
6
votes
1answer
422 views

Using the pipe operator (“|”) when executing system commands

I'd like to emulate ls -tlra | grep <search term> in Wolfram. I have tried ...
6
votes
2answers
332 views

Linux’s Bash shell in Windows 10 and mathematica

As we know, Linux’s Bash shell is coming to Windows 10. Now, I want to know, how to using Run[] command or other commands to run some commands like gfortran installed in Linux of Win10 ? And, is it ...
6
votes
3answers
594 views

Running PowerShell commands in Mathematica

I'm trying to execute a PowerShell command using Mathematica. Someone has made it before? I tested my command direct in PowerShell, and it worked nice, but no idea on how can I make Mathematica to ...
6
votes
2answers
155 views

Behavior of $PreRead in Kernel

I am interested in making a simple accounting style line calculator that allows me to interact with it something like this: ...
6
votes
0answers
244 views

How can I create a REPL for Mathematica in Sublime Text

I would like to be able to interact with Mathematica command line interface from within Sublime Text. Sublime Text has a package called Sublime REPL that provides an interface for different ...
6
votes
0answers
200 views

Passing UTF-8 to wolframscript on the command line

I am trying to use Unicode input to wolframscript -c, like so: $ ./wolframscript -c '1/∞' â^(-1) The source of this behavior ...
5
votes
1answer
581 views

Can't run Bash scripts from within Mathematica 10.1

I am working on Debian 8 (Jessie) and Mathematica 10.1 (64-bit) Home Edition. I have created a script named curl_fetch.sh. It contains the line: ...
5
votes
1answer
519 views

How to use shell commands inside mathematica

I want to know how to use simple shell commands inside mathematica. For example: I want to set the current directory as the NotebookDirectory using shell command PWD. Something like ...
5
votes
1answer
267 views

Is it possible to get AltGr key to work in Math.exe?

For some reason when you run Math.exe form windows command line, Mathematica disables the AltGr key. This is a bit annoying since my keyboard locale has the keys [, ], {, }, @, $, \, | located under ...
5
votes
1answer
56 views

Can we make preread replacements in an *.m* file before being run?

This the second question of (152743), the preamble of which is reproduced here: Those who don't have/prefer the front end of Mathematica will either use a plain ASCII editor to write a script in an ...
5
votes
1answer
57 views

Can we make new definitions for InputForm in packages?

Those who don't have/prefer the front end of Mathematica will either use a plain ASCII editor to write a script in an .m file or just use Mathematica directly from ...
5
votes
1answer
231 views

How to recover WolframScript's former `-run` functionality?

With the 10.4 version of WolframScript, I could run something like ...
5
votes
0answers
76 views

Processor Detection Problem with Mathematica in Linux command-line

Here is the problem, there are two ways to launch Mathematica in Linux: Double click a notebook file in Desktop (GUI mode). It gives: $ProcessorCount (* 4 *) ...
5
votes
0answers
43 views

List of symbols that do not work in console?

Symbols that do not work in the Wolfram Cloud have a nice "no cloud" icon. Is there something similar for symbols that don't work in the wolfram console? Or perhaps a full list of functions that do ...
5
votes
0answers
43 views

The second escaped path breaks command execution

Due to a terrible chain of events I had to reinstall part of my software. Git among it, but a newer version. Something changed because earlier all four evaluations were giving me a version info: <...
5
votes
0answers
74 views

Can I customize the shell command line prompt?

Is there a way to customize the command line prompt (e.g., colorize it) for MathKernel when it runs as a shell command (in general, but specifically on OS X)?
5
votes
0answers
219 views

Can Apple's Numbers spreadsheet link to a Mathematica function? [closed]

I use Apple's Numbers spreadsheet for a single thing, a double entry accounting model to understand complicated financial transactions. A current model depends on the value of a single initialization ...
5
votes
0answers
336 views

How can I run MUnit tests outside of Workbench under Linux?

I would like to run MUnit tests from the command line. On Mac OS, I can do this: ...
4
votes
2answers
62 views

Run retrieving stdout without using RunProcess

Is it possible to run a complex terminal command and retrieve its output. I understand that RunProcess could do this but it cannot directly execute full command and it seems rather complex to rewrite ...
4
votes
1answer
572 views

Problem calling Python scripts from Mathematica

so I'm running into a strange problem using Import[] to import the output of a python 3.6 script. I have a script my_script.py ...
4
votes
1answer
808 views

How to activate Mathematica through remote license server from command line?

I am trying to activate Mathematica from the command line (I am logged remotely) by connecting to a remote network license server, but no success so far. I run the command ...
4
votes
1answer
3k views

Running a Mathematica Notebook from command line and saving the output [closed]

I am working on a project that requires some calculations to be done in Mathematica. I don't know Wolfram language and I don't have the time to learn it (I am using a 30-day trial) so I have a python ...
4
votes
1answer
549 views

Print without newline in command line mode

Does Mathematica provide any way to print text to the terminal without a newline at the end when running in command line mode? There are many workarounds with the notebook interface, but this ...
4
votes
1answer
160 views

Quit Mathematica kernel if no license available

I'm running the Mathematica kernel math from inside a makefile to generate C++ code, like so: ...
4
votes
0answers
99 views

Using an existing local kernel when launching from command line

I am trying to setup a web interface to a couple of Mathematica scripts, which in itself is quite simple: ...
4
votes
0answers
153 views

Can one combine Mathematica with bash script?

For example, I create a Mathematica nb file which can work on a set of parameter values or several files at once. It needs me to change the parameter after finishing computing one parameter. If I ...
3
votes
1answer
134 views

Creating flags to use with wolframscript?

Is it possible to create flags to pass arguments into a script with wolframscript? I am trying to pass multiple variables that correlate to specific keys. For example, wolframscript -script ...
3
votes
2answers
476 views

Under OS X, is there a way to view graphics output when running in the command line?

Being a long time unix shell person, I prefer Mathematica's command line interface, over the notebook. (command history, etc...) It just learned that on OS X, the cli is available as MathKernel. ...
3
votes
1answer
304 views

Key Mapping in Command Line Mode

I would like to map Ctrl-U to "kill line" when using Mathematica 9.0 in command line mode (i.e. not within the front end, but when called from a Unix command line by "math"). I am aware that (on a ...
3
votes
1answer
417 views

How to execute a Mathematica notebook in a shell script to produce plots/graphics [duplicate]

I want to produce some plots/graphics for a large amount of data on a computing cluster in a high-throughput way. I'd like to do this by piping results through Mathematica where I'd apply some post-...
3
votes
1answer
2k views

Running Mathematica code from a command line

How can I schedule custom Mathematica code to run on my windows machine? I need to schedule some code to run on my computer (Windows, Mathematica 10.0). I'm trying to get something to run via a ...
3
votes
1answer
228 views

How to run multiple scripts in a row from command line using the same kernel?

Here is my shell script so far (I am using MacOSX): ...