I can't find any documentation that explains my observations in sufficiently enough terms. After I run the below code, I perform a kill -SIGINT $my_pid from a different shell. I will correctly see #### received trap 2 the first two times. However, the wait command gets interrupted on each signal. Why?
#!/bin/bash
for s in {0..64}
do
trap "echo '#### received trap $s'" $s
done
./code &
pid=$!
my_pid=$$
wait $pid
wait $pid