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 Answers 2

12

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

5
  • 2
    And in which situation this is important?
    – hakre
    Jul 4, 2014 at 13:01
  • 12
    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). Jul 4, 2014 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 4, 2014 at 15:12
  • 1
    @AndreasWiese: You should add your comment to your answer.
    – Zaz
    Feb 6, 2017 at 20:16
  • I still don't get it. I have a long running command. I ran it with and without the -i option and did a Ctrl+C both times. The output file was identical. What's the point of this. Oct 28 at 11:38
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.

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. Apr 4, 2014 at 16:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .