Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: kill the LHS command of a pipe once the RHS command terminates



On Sat, Jul 6, 2019 at 4:56 PM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> On 2019-06-29 09:17:13 -0700, Bart Schaefer wrote:
> >
> > If you're going to kill the right-side with an interrupt or other
> > signal, you'll have to arrange to trap that so that the subsequent
> > kill isn't also skipped.
>
> but I would like to get rid of the job status that appear at the end.

zsh% () {
setopt localoptions nonotify nomonitor
coproc { echo foo; exec >&-; sleep 60 }
trap "kill $!" INT EXIT
less -f <&p
}



Messages sorted by: Reverse Date, Date, Thread, Author