I am starting
entr as a subshelled background process as described in its man page to listen to changes to some file foo, occuring during interactive use of some program
baz, and I would like to terminate that background process on completion of
(echo foo | entr echo bar &) && baz;
I found this question which tries to get the process id of a background process started in this way, which seems very convoluted to do in bash. Is there some way to kill it?