System: Windows 10 professional. Mathematica Version: 10.3.0 English.
RunProcess
doesn't work in my computer as described in tutorial.
The right result the function should give:
I tried different RunProcess
examples given in the documentation and it seems that most of them work on Windows not as expected. For instance:
RunProcess[$SystemShell, All, "echo example line 1
echo example line 2
exit
"]
Outcome as follows:
<|"ExitCode" -> 0, "StandardOutput" -> "Microsoft Windows [\[Degree]æ\[PlusMinus]¾ 10.0.10586] (c) 2015 Microsoft Corporation¡£\[PlusMinus]Some text... C:\Users\Veya\Documents>echo example line 1 example line 1 C:\Users\Veya\Documents>echo example line 2 example line 2 C:\Users\Veya\Documents>exit ", "StandardError" -> ""|>
And it should be shorter:
<|"ExitCode" -> 0, "StandardOutput" -> "example line 1 example line 2 ", "StandardError" -> ""|>
Question: What am I doing wrong? Are problems due to my Windows settings? How can I get results looking as described in the documentation?
Why I need RunProcess
I want to use MaTex in Mathematica; it is based on RunProcess
.
Addition:
I've also directly tried Environment
command from documentation but get $Failed
.
Environment["HOME"]
> $Failed
possible issues
in documentation? i.e.optionC = If[StringFreeQ[$System, "Windows"], "-c", "/c"]; RunProcess[{$SystemShell, optionC, "echo example line"}]
$\endgroup$<|"ExitCode" -> 0, "StandardOutput" -> "example line ", "StandardError" -> ""|>
It seems like a right result. But I don't know what it means? $\endgroup$Environment
. This code didn't work either.(InputEnvironment["HOME"]
Output$Failed
) Maybe it is the source of problem. But I also don't know how to fix it. $\endgroup$