Questions tagged [command-line]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
28 views

Formatting code in .wl and .m files from the command-line?

I use an external editor (Sublime Text) to edit my .wl and .m files and run them with WolframKernel from the command line. This means everything I do is outside of Mathematica. Is there a way I can ...
0
votes
0answers
19 views

MathKernel vs wolframscript and passing parameters from the command line

I have a script that works perfectly well when invoked with MathKernel -script. However I would like to pass it arguments. I can do this using ...
16
votes
1answer
167 views

How to create a CLI for Wolfram language scripts?

Former question: How to use wolframscript to develop flexible command-line tools? I am currently changing a notebook into a wolframscript for a "production" environment, where I plan to ...
4
votes
2answers
130 views

Check if the license is available otherwise quit

Suppose I launch many parallel Mathematica scripts with a command like #!/bin/bash math -run '<<MyScript.m someparameters' My license has a limited number of ...
2
votes
1answer
82 views

Execute notebook from command line?

Starting with a notebook CDoc.nb that contains one input cell: CreateDocument["\ttest"] If I evaluate this in the ...
2
votes
1answer
51 views

How to ListPlot from Command Line In Math 12?

I almost always use Mathematica from the command line (Mac/Xwindow) and have things set up to plot/display graphics using Preview, which is great. The problem is, some functions like ListPlot don't ...
1
vote
0answers
33 views

In warning messages, can multi-storey expressions be flattened?

I receive the following output in command line: ...
1
vote
0answers
52 views

Problem with RunProcess

I'm trying to use the RunProcess function to run docker on Mac OS using Mathematica. But there is a problem: ...
1
vote
0answers
110 views

WolframKernel not found when running WolframScript

While attempting to run wolframscript in linux, I get the error "WolframKernel not found. Use -configure to set WOLFRAMSCRIPT_KERNELPATH Or export WolframKernel=/yourpath/WolframKernel" I am ...
1
vote
1answer
49 views

How to unprotect/see the code of a command in Mathematica [duplicate]

How do you see the code form of a command in Mathematica? I know there is a command in Mathematica, "Unprotect[]", but how do you actually use this?
3
votes
0answers
84 views

Why can't I authenticate my SSH connection in Mathematica?

I'm trying to SSH into my Cyberpower PDU41001, which is connected to my computer via Ethernet cable. My computer runs Windows 10. I have enabled SSH communication on the device by logging into the IP ...
9
votes
1answer
374 views

How to reproduce Wolfram Language's base64 encoded string with command-line tool?

With Wolfram Language: In[7]:= ExportString["foobar中文", "Base64"] Out[7]= "Zm9vYmFyXDo0ZTJkXDo2NTg3" With the closest command-line software I could think of <...
0
votes
0answers
46 views

Parallel Computation: Kill kernels which have completed the jobs while others keep running

I launch 20 parallel kernels in the background using nohup math -run "<<file.m" &> file.out The nature of computation is integration over various ...
0
votes
1answer
97 views

Problems in running mathematica file in the background

I have converted my Mathematica notebook into .m file and need to run it in the background on a remote server. I am launching the run from my laptop, on a remote workstation. I need it to obey the ...
2
votes
0answers
42 views

J/Link with Environment Variables and Command-Line Parameters

I have inherited a large number of Java files with classes I am trying to call from Mathematica via J/Link. They are legacy and am not at liberty to modify. A few are used on command-line scripts (...
2
votes
1answer
108 views

Can't save output in the script mode

I encounter the problem that I can't save any output from Mathematica script. Here is a minimal example. test.m ...
2
votes
2answers
135 views

is there something like a “foreach” mode from the command line? Like in perl?

With perl we can run perl -p . That wraps a foreach loop around the code and executes the code on the file. What I'm looking for is something like StringReplace[filename,"\t"->","] and then I get a ...
9
votes
1answer
171 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 ...
2
votes
0answers
113 views

Arrow key problem with mathematica 12 and bash version 5

I want to know if anyone experiences the issue with mathematica-12 with bash-5? I am using the command line interface of mathematica. Now when I do up arrow or down arrow to go to history, it does ...
1
vote
0answers
53 views

Unable to execute Wolfram script by calling a package

I am working on a script which loads a package called test. When I try to run the same from my command line, I am seeing my input printed without execution. ...
0
votes
0answers
92 views

Readable formula output on command line

I was trying to solve some differential equations. Mathematica is a little expensive to me, so I went for the free Wolfram Engine for Developers. It is said that the engine offers the full power of ...
6
votes
1answer
466 views

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

I'd like to emulate ls -tlra | grep <search term> in Wolfram. I have tried ...
4
votes
2answers
85 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 ...
2
votes
1answer
129 views

How to change the terminal size programmatically that is opened by `RunProcess`?

Why isn't the following linux command working from the RunProcess interface? I want to change the terminal size programmatically and then display the information: <...
2
votes
1answer
148 views

RunProcess fails when a directory path contains a space

In my "Documents" folder I've created two directories with names "тест" and "тест 2". When I try to use RunProcess for obtaining directory listing for the first ...
3
votes
1answer
144 views

Is there a way to omit the “In[1]:=” prompt?

I'm using a command-line interface of Mathematica, or /usr/bin/wolfram. In wrapping this cui program with GNU Readline library, I would like to omit the ...
3
votes
1answer
175 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 ...
0
votes
0answers
125 views

Mathematica on Command Line: graphics errors under Mojave

Running Math 11 (or earlier) under Mac Mojave (10.14.5) from the command line, as soon as I display graphics I get a series of errors that look like this: /BuildRoot/Library/Caches/com.apple.xbs/...
1
vote
0answers
50 views

Command line session Linux from Mathematica

Using RemoteConnect and RemoteRunProcess I can create a remote session such that successive commands are done in the same ...
0
votes
1answer
495 views

How to run Mathematica as a .m file

I've created this Dummy.nb file with the code x=2 x+3 and exported it as Dummy.m. Whenever I try to run it on the command line with math -run Dummy.m or math -...
4
votes
2answers
95 views

How do I get TexForm to work on the command line? (Windows only)

I try to run: wolframscript -code "TeXForm[""2+2""]" But I end up with: TeXForm[2+2] I am using Windows. From my research,...
3
votes
0answers
48 views

Is there a limit to the amount of data that can be Run?

I need this command to work through the WolframKernel and it seems well beyond my understanding why it does not work above a certain amount of data size I'm passing to ...
3
votes
0answers
131 views

Not getting any output from mathematica script

I am completely new, so this question may be trivial, but I can't find any answers in the Wolfram documentation. I am playing around with scripting in Mathematica, but I cannot seem to get any type ...
7
votes
1answer
175 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 ...
2
votes
0answers
328 views

Convert .nb to .m with a single script or command line in linux [duplicate]

I have some scripts in ".nb" format and I am more used to launch them in Linux command line in Linux but I need them in ".m" format. Usually I open the ".nb" script with the Mathematica Notebook and ...
1
vote
1answer
52 views

RunProcess Does not Stop

I want to convert a latex file to a pdf file, using Mathematica. To do that, I installed MikTex and the I can run the following command in cmd: lualatex main.txt ...
3
votes
0answers
188 views

Command line arguments to wolframscript interact strangely with -file option

In order to avoid script-defined command-line arguments clashing with existing arguments to wolframscript, it appears you are supposed to use the ...
11
votes
2answers
224 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) ...
4
votes
0answers
115 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: ...
3
votes
1answer
918 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-...
2
votes
0answers
79 views

can't start r process in cmd

...
6
votes
0answers
345 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 ...
7
votes
1answer
1k 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 ...
2
votes
0answers
92 views

Make exponents line up with their base in terminal

For some reason, the exponents displayed on a terminal (Mac OS X 10.13) Mathematica 11.2 do not line up with their bases: ...
0
votes
1answer
619 views

FindRoot fails 100 iteration precision

I am attempting to find roots of a complex equation that involves exponential functions and small approximation values. I have had success using FindRoot for values ...
6
votes
0answers
264 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
0answers
82 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 *) ...
2
votes
1answer
58 views

Echoing commands when running packages in batch mode

I run Mathematica packages in batch mode. I need a log file showing input commands and displaying their output. I tried these commands ...
0
votes
1answer
101 views

Loop command in Interpolation

I have a following interpolation function A[x,y] defined below. The variable y has some fixed range which is different for each <...
0
votes
0answers
138 views

How to plot imaginary parts of complex valued list of data separately?

I am using a user-defined function syscomplex[t1,t2,a] which calculates the complex energies of a system in a Mathematica-based software. Here: ...