RunProcess¶
Runs a program to completion and reports its exit code and output. A string names the program; a list gives the program and its arguments. The program is started directly, not through a shell.
A property name picks one of the results:
A third argument is fed to the program's standard input:
ProcessDirectory runs the program in a directory, and ProcessEnvironment
gives it its environment variables:
A ProcessEnvironment replaces the environment outright, search path
included, so the program is looked up in its PATH — an absolute name
needs none:
$ wo 'RunProcess[{"/bin/sh", "-c", "echo $GREETING"}, "StandardOutput", ProcessEnvironment -> <|"GREETING" -> "hi"|>]'
hi
A program that cannot be found gives $Failed: