problem is, since long_running_process does not continually produce output but only some times, when i try to interrupt this pipeline with ctrl-c I have to wait until it produces some output for the process to terminate (because, as I understand it, when it tries to write to the pipe it receives a sigpipe due to it being already closed)
I have tried various constructs with trap and even coproc to be able to intercept the ctrl-c and send a sigpipe to the long running process, but to no result.
I wonder if someone has some solution to share for this problem, thanks