1{ trap "echo got TERM" TERM; sleep 3; }& sleep 1; kill $!; wait
2echo Done: $?
3