I'd like to use Python's os.execv to replace my current process, but I also want the new process to send stdout to another process (to collect logs and ship them over the network). The process collecting logs also needs to be started by the original Python process.
I'm guessing I need to do some fork, dup2, execv stuff, but I need some help.
In bash, it might look something like this
#!/bin/bash
exec ./foo ∣ ./bar
subprocessmodule can do this for you: gist.github.com/JacobIRR/dced5ce0f19e4f376aaef19d0e80d9d7exechas no effect.exec ./foo > >(./bar).