In another script I was leery about running rm -f -- /path/foo* so I instead used
find /path -mindepth 1 -maxdepth 1 -name "foo*" -delete
because then the glob can't affect find's behaviour in weird ways.Most likely set -e is enough protection against mktemp failing and the rm -f glob probably would've been just fine, but shell scripting has enough footguns that sometimes I can't help but go overboard with paranoia.