# dialog, trap and SIGTRAP

I've seen a lot of examples using dialog tools into scripts with lines as follows:

trap "rm \$datafile" 0 1 2 5 15


What I don't understand is the meaning of SIGNAL 5, ok I know is SIGTRAP. But shame on me, still I don't understand its real significance...

-

There's a manpage signal(7):
Signal         Value   Action   Comment

This signal (as the manpage suggests) is primarily used by debugging tools like gdb or strace, respectively the ptrace(2) system call. If one process is tracing another process's activity through ptrace(2), SIGTRAP will be heavily used to »interrupt« the child, even though the child in most cases won't effectively know this happened (a process monitored through ptrace(2) does not necessarily notice which signal had been sent to it, because of the tracer being able to intercept and filter delivered signals and SIGTRAP primarily serves to inform the tracer that something noticable happened).
Looking at the ptrace(2) manpage is very enlightening in this case.