This command works on Windows:
ReadList["!" <> "echo hello", String]
Assuming the "!" suggests Windows command shell (verified as $SystemShell
),
However, I tried the above code in msys.bat
which is a Unix-type shell on Windows, and it did not work. How can I do the above operation if it is not a Windows command shell?
Do I need to replace "!" or change $SystemShell
somewhere?
I have tried RunProcess
(or ReadList
) as:
path = "C:\\MinGW\\msys\\1.0\\msys.bat";
RunProcess[path, "StandardOutput", "echo Hello world
exit
"]
This opens msys.bat
in a new window, and Mathematica keeps running.
RunProcess
only runs executables, not batch files (which must be interpreted by the windows shell).ReadList
may have the same problem. $\endgroup$cmd /c msys.bat
or similar? $\endgroup$