I\'ve been trying to figure out how to pipe a few processes in Java using the new ProcessBuilder. I can\'t find a suitable example of what I want to do and when
ProcessBuilder
You don't need a pipe in this case.
"grep bla test.txt"
however assuming you need a pipe, you need to use a shell like bash
"/bin/bash", "-c", "grep foo text.txt | grep bar"
Start a child thread for each Input-/OutputStream pair with a simple copy loop in run().
Input-
OutputStream
run()