Hacker News new | ask | show | jobs
by lioeters 449 days ago
Useful tip, I suppose it will look like:

  temp=$(mktemp)
  trap 'unlink $temp' EXIT
  # Do things
1 comments

Exactly. And if your cleanup is more involved you can call a cleanup function.