10

The title basically says it all. tee has an option --ignore-interrupts:

-i, --ignore-interrupts   ignore interrupt signals

Can anyone explain/give an example in which situation this is important? Thanks!

2 Answers2

12

When called with -i, tee ignores the interrupt signal (SIGINT), which is normally issued by your terminal when hitting Ctrl+C.

Andreas Wiese
  • 2,111
  • 16
  • 13
  • 2
    And in which situation this is important? – hakre Jul 04 '14 at 13:01
  • 11
    If you're using `tee` in a command line pipe like `some long running command | tee output`, this might be helpful if you want to kill the input provider with `Ctrl+C`, but want `tee` to exit gracefully (by reading `EOF` from the pipe). – Andreas Wiese Jul 04 '14 at 13:46
  • Ah, very useful and a nice description, I was a little irritated. Now I'll add it to some of my scripts. Thanks! – hakre Jul 04 '14 at 15:12
  • 1
    @AndreasWiese: You should add your comment to your answer. – Zaz Feb 06 '17 at 20:16
0

If tee is used with -i, --ignore-interrupts options, It wont accept any interrupt signals like CNTRL+C ^C or Kill signals Except signal KILL or Signal Terminate.

Vasanta Koli
  • 101
  • 1
  • 1
    That's not quite right; `tee` does _exactly_ what the option states and only ignores `SIGINT`. All other signals are delivered as without `-i`. – Andreas Wiese Apr 04 '14 at 16:17