only one nested bash process (NB: OS.System = vfork + exec /bin/sh in RTS is faster than Posix.Process.fork/exec in ML);
authorwenzelm
Tue, 01 Mar 2016 12:59:46 +0100
changeset 62483 c13dac251a81
parent 62480 f2e8984adef7
child 62484 4759dbb35148
only one nested bash process (NB: OS.System = vfork + exec /bin/sh in RTS is faster than Posix.Process.fork/exec in ML);
src/Pure/Concurrent/bash.ML
--- a/src/Pure/Concurrent/bash.ML	Tue Mar 01 10:32:55 2016 +0100
+++ b/src/Pure/Concurrent/bash.ML	Tue Mar 01 12:59:46 2016 +0100
@@ -35,16 +35,13 @@
         Multithreading.with_attributes Multithreading.private_interrupts (fn _ =>
           let
             val _ = File.write script_path script;
-            val bash_script =
-              "exec bash " ^
-                File.shell_path script_path ^
-                " > " ^ File.shell_path out_path ^
-                " 2> " ^ File.shell_path err_path;
             val _ = getenv_strict "ISABELLE_BASH_PROCESS";
             val status =
               OS.Process.system
                 ("exec \"$ISABELLE_BASH_PROCESS\" " ^ File.shell_path pid_path ^
-                  " bash -c " ^ quote bash_script);
+                  " bash " ^ File.shell_path script_path ^
+                  " > " ^ File.shell_path out_path ^
+                  " 2> " ^ File.shell_path err_path);
             val res =
               (case Posix.Process.fromStatus status of
                 Posix.Process.W_EXITED => Result 0