Props for this. Just last week, I was searching for a similar solution and ended up coding this - <a href="https:&#x2F;&#x2F;github.com&#x2F;code-mancers&#x2F;invoker&#x2F;blob&#x2F;master&#x2F;lib&#x2F;invoker&#x2F;power&#x2F;setup&#x2F;files&#x2F;invoker_forwarder.sh.erb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;code-mancers&#x2F;invoker&#x2F;blob&#x2F;master&#x2F;lib&#x2F;invo...</a><p>It doesn&#x27;t kill the shell, when one of the process dies but kills the processes if shell dies. There is some trick involved in the way trap gets called though when shell dies and without waiting on the processes twice - shell exits without killing child processes.