1 2v=$( 3 ${SH} -c 'trap "echo ok; exit" USR1; kill -USR1 $$' & 4 # Suppress possible message about exit on signal 5 wait $! >/dev/null 2>&1 6) 7r=$(kill -l $?) 8[ "$v" = "ok" ] && { [ "$r" = "USR1" ] || [ "$r" = "usr1" ]; } 9