What does set -T mean in bash? What does it do? I believe it is related to traps in Unix but I am not sure.
I found this:
Many of such constructs become more simple if traps would be called immedeately, while is foreground child is still running. You would just install a trap handler that does "something" about the problem and it would be called everytime you hit SIGINT (or SIGQUIT). Just as signals handler in C programs are called immedeately. Maybe I am too much of a C programmer, but I find the delayed sh behaviour very non-intuitive.
#! /bin/sh onsig() { trap SIGINT kill -SIGINT $$ } set -T # set async execution of traps on FreeBSD trap onsig SIGINT ./some-blocking-program set +T # set traps execution behaviour back to normalThis makes the trap handler a bit more complicated, but it allows you to write the main part of your shell script as usualy, without keeping in mind that a program may block and taking the appropriate action about it.