RunThrough["command",expr]
executes an external command, giving the printed form of expr as input and taking the output, reading it as Wolfram Language input, and returning the result.
RunThrough
RunThrough["command",expr]
executes an external command, giving the printed form of expr as input and taking the output, reading it as Wolfram Language input, and returning the result.
Details
- RunThrough writes the InputForm of expr on the standard input for command, then reads its standard output and feeds it into the Wolfram Language.
- RunThrough starts command, gives input to command, then terminates the input.
Examples
Basic Examples (1)
Run a Wolfram Language kernel in text mode, having it put a result in a temporary output file:
mathcommand = StringReplace[First[$CommandLine], "WolframKernel" -> "wolfram"];outputfile = FileNameJoin[{$TemporaryDirectory, "rtout"}];RunThrough[mathcommand <> " -noprompt", Unevaluated[Put[Factorial[47], outputfile]]]The result is now in the file:
FilePrint[outputfile]DeleteFile[outputfile]See Also
Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), RunThrough, Wolfram Language function, https://reference.wolfram.com/language/ref/RunThrough.html.
CMS
Wolfram Language. 1988. "RunThrough." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RunThrough.html.
APA
Wolfram Language. (1988). RunThrough. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RunThrough.html
BibTeX
@misc{reference.wolfram_2026_runthrough, author="Wolfram Research", title="{RunThrough}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/RunThrough.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_runthrough, organization={Wolfram Research}, title={RunThrough}, year={1988}, url={https://reference.wolfram.com/language/ref/RunThrough.html}, note=[Accessed: 13-June-2026]}