You can test it out quickly enough:
$ cat test.sh trap : INT HUP USR1 sleep 10h $ ./test.sh & [1] 29668 $ grep SigCgt /proc/$(pgrep test.sh)/status SigCgt: 0000000000010203 $ grep SigCgt /proc/$(pgrep sleep)/status SigCgt: 0000000000000000
So trap doesn't affect binaries.
What about scripts?
$ cat blah.sh #! /bin/bash grep SigCgt /proc/$$/status $ cat test.sh #! /bin/bash trap : INT HUP USR1 ./blah.sh $ ./test.sh SigCgt: 0000000000010002
So something's being caught. But wait!
$ ./blah.sh SigCgt: 0000000000010002
Looks like those signals are handled anyway.
The manpage has this to say:
When a simple command other than a builtin or shell function is to be executed, it is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell. ... · traps caught by the shell are reset to the values inherited from the shell's parent, and traps ignored by the shell are ignored
If you want to convert that bitmask to a set of signals, try:
HANDLED_SIGS=$(awk '/SigCgt/{print "0x"$2}' /proc/$PID/status) for i in {0..31} do (( (1 << i) & $HANDLED_SIGS )) && echo $((++i)) $(/bin/kill --list=$i); done | column
In this case, the set of signals that were handled without trap were:
$ HANDLED_SIGS=0x0000000000010002 $ for i in {0..31}; do (( (1 << i) & $HANDLED_SIGS )) && echo $((++i)) $(/bin/kill --list=$i); done | column 2 INT 17 CHLD