fork download
  1. template run_process_output {
  2. alias("_arg0") command;
  3.  
  4. var("true") not_finished;
  5. value("") result;
  6. backtrack_point() break;
  7. If (not_finished) {
  8. not_finished->set("false");
  9. sys.start_process(command, "r", ["keep_stderr":"true"]) proc;
  10. If (proc.is_error) {
  11. break->go();
  12. };
  13. proc->read_pipe() read_pipe;
  14. If (read_pipe.is_error) {
  15. break->go();
  16. };
  17. backtrack_point() read_again;
  18. read_pipe->read() read;
  19. If (read.not_eof) {
  20. result->append(read);
  21. read_again->go();
  22. };
  23. break->go();
  24. };
  25. }
  26.  
  27. process main {
  28. call("run_process_output", {{"/bin/echo", "HELLO"}}) run;
  29. print(run.result);
  30. }
  31.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty