Comes with a lot trial and error.
The above will work as (tested in ash/dash/bash):
#!/usr/bin/env sh
trap "echo exiting" INT
sleep 1h
But to your point, yes, how to actually know that without doing trial n' error & stackoverflow.Thanks for the `sleep 1h`, didn't know that you could do hour as unit :)
(edited: turned out INT is enough to trap)