On sh
or bash
, how do I exit the first process in a pipe when the second one has exited?
I was using the following to get input from the network:
$ nc -l 1234 | myprog
myprog
exited due to an internal cause but nc
continues to live. Is it possible to stop nc
also?