
Hi,
How can I call a program (like, for instance, 'grep text *') and get the standard output? (...)
http://haskell.org/ghc/docs/latest/html/libraries/process-1.0.0.0/System-Pro...
I was using the following: (...) do (_pIn, pOut, pErr, handle) <- runInteractiveCommand command -- Wait for the process to finish and store its exit code exitCode <- waitForProcess handle (...)
I also used runInteractiveCommand, which I found in the page quoted above. I read the output handle without waiting for the process to finish, and I thought runInteractiveCommand would actually not return before the external process finishes, which your code showed me to be a wrong prejudice. That's nice. In my situation, the output of the program can be really big, so I prefer not to wait for it to finish before I do stuff with the output, but I'll probably use your code in most situations, since I can check the exit code before doing anything. Best, Maurício