We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8645a09 commit bc36181Copy full SHA for bc36181
src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java
@@ -615,8 +615,11 @@ public static long link(String before, String after) {
615
public static long shell(String cmd) {
616
long retval = 255;
617
try {
618
- Process proc = new ProcessBuilder("sh", "-c", cmd)
619
- .inheritIO().start();
+ String os = System.getProperty("os.name").toLowerCase();
+ ProcessBuilder pb = os.indexOf("win") >= 0
620
+ ? new ProcessBuilder("cmd", "/c", cmd.replace('/', '\\'))
621
+ : new ProcessBuilder("sh", "-c", cmd);
622
+ Process proc = pb.inheritIO().start();
623
proc.waitFor();
624
retval = proc.exitValue();
625
}
0 commit comments