RunThrough["command", expr]
executes an external command, giving the printed form of expr as input and taking the output, reading it as Mathematica input, and returning the result.


  • RunThrough writes the InputForm of expr on the standard input for command, then reads its standard output and feeds it into Mathematica.
  • RunThrough starts command, gives input to command, then terminates the input.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Run a Mathematica kernel in text mode, having it put a result in a temporary output file:

Click for copyable input
Click for copyable input
Click for copyable input

The result is now in the file:

Delete the temporary file:

Click for copyable input
New in 1
New to Mathematica? Find your learning path »
Have a question? Ask support »