Questions tagged [command-line]

136 questions
9
votes
2 answers

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 will only show some incomprehensible codings of…
Tim
  • 317
  • 3
  • 8
9
votes
3 answers

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 this? Update: This differs from the post Mr. Wizard…
M.R.
  • 31,425
  • 8
  • 90
  • 281
7
votes
1 answer

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, I have to add Print to show anything. What I'd…
Nasser
  • 143,286
  • 11
  • 154
  • 359
7
votes
2 answers

Using the pipe operator ("|") when executing system commands

I'd like to emulate ls -tlra | grep in Wolfram. I have tried Module[{}, SetDirectory[dir] RunProcess[{"ls", "-tlra", "|", "grep", }, "StandardOutput"] ] which doesn't seem to work. Is there a way to use the "pipe"…
George
  • 3,145
  • 7
  • 21
6
votes
1 answer

Can I run terminal commands such as SFTP/SSH through a mathematica notebook?

I'm generating an array using Mathematica which produces a single .dat file. I then use SFTP/SCP to transfer it to the staff Linux cluster. This isn't a particularly difficult task but is there a way to execute the terminal command through a…
jimbob97
  • 103
  • 3
6
votes
1 answer

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 SetDirectory[$PWD] I saw there are some commands like Run["!echo…
BabaYaga
  • 1,836
  • 9
  • 19
4
votes
1 answer

Quit Mathematica kernel if no license available

I'm running the Mathematica kernel math from inside a makefile to generate C++ code, like so: a.out: g++ -o a.out main.cpp main.cpp: math -run "<< \"generate_main.m\"" # generates main.cpp However, sometimes there is no Mathematica…
3
votes
1 answer

Changing Wolfram command line output into copyable text

I generated a long polynomial using the Wolfram command line, with divisions and exponents. But the divisions look like this: 4 - 5 And the exponents are on a different line: -6 10 And I need to copy the output to GeoGebra, so I need to have the…
ProgramFOX
  • 143
  • 6
3
votes
2 answers

Send commands directly from OSX terminal to Notebook front end

I'm used to programming in a terminal and in Vim, and would love the ability to send commands from a terminal window directly to the notebook front end. Currently, I have to choose between: Cutting and pasting between the terminal and the .nb…
toomey8
  • 195
  • 5
2
votes
1 answer

Run example in Documentation not working in 10.2?

From Run's documentation commandstring = First[$CommandLine] <> " -noprompt -run \"Put[Factorial[20],ToFileName[$TemporaryDirectory,ToString[temp1]]];Quit[]\"" (* "WolframKernel -noprompt -run…
Ronald Monson
  • 6,076
  • 26
  • 46
2
votes
1 answer

call a zsh alias in the mathematica notebook

I want to call this zsh alias in a mathematica cell? my zsh alias is called testAlias I have tried many mathematica functions and found that ReadList can send strings to my zsh shell (or internal command line anyhow) Unfortunately alias's don't…
Conor
  • 7,449
  • 1
  • 22
  • 46
0
votes
1 answer

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 -script Dummy.m, a local interactive Mathematica kernel starts up, which is not what I…
Pineapple
  • 111
  • 4