trapはサブシェルに継承しない
shell - Is trap inherited by a subshell? - Unix & Linux Stack Exchange