<to...@tuxteam.de> writes:

> On Tue, Oct 01, 2024 at 01:53:26PM +0300, Anssi Saari wrote:
>> Greg Wooledge <g...@wooledge.org> writes:
>> 
>> > On Mon, Sep 30, 2024 at 14:08:19 +0300, Anssi Saari wrote:
>> >> Tim Woodall <debianu...@woodall.me.uk> writes:
>> >> 
>> >> > However on trying to debug something else, I wanted to run it like this:
>> >> >
>> >> > ./script |& tee log
>> >> >
>> >> > and now it doesn't clean up if I <ctrl c> it.
>> >> 
>> >> Just a point here about tee since I didn't see anyone else mention
>> >> it. tee has had the -i option to ignore interrupt signals for ages. The
>> >> non-obvious side effect is INT signals pass up the pipe, in your case to
>> >> bash running your script.
>> >
>> > Signals don't "pass up the pipe".  A process either receives a signal,
>> > or it doesn't.
>> 
>> I'm not sure now, are you just squabbling over semantics or are you
>> disputing my description of what happens?
>
> Explain to us what you really mean by "signals pass up the pipe", then things
> might become clearer.

I realize I didn't spell it out. It's the, to me, obvious solution to
Tim's problem, as he wrote:

QUOTE
./script |& tee log

and now it doesn't clean up if I <ctrl c> it."
END QUOTE

Running ./script |& tee -i log works as expected. The script gets the
INT signal and cleans up.

To me, "signal passing up the pipe" is an apt analogy of how things work
in practice.


Reply via email to