lioeters 3 days ago

Useful tip, I suppose it will look like:

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

1
Galanwe 3 days ago

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