I have a script I wrote in Bash that I'm trying to modify to be POSIX-compliant. I have managed to get everything working except I cannot get the EXIT trap to trigger when the process is terminated with killall, CTRL+C or closing the terminal - as it did with Bash. Here is my exit trap:
#!/bin/sh
TMP=$(mktemp /tmp/countdown.XXXXX)
trap 'rm -rf $TMP' EXIT