Skip to content

Instantly share code, notes, and snippets.

@echu
Created June 20, 2018 15:54
Show Gist options
  • Select an option

  • Save echu/e392a46f0c67e9ad1a301724137c61c8 to your computer and use it in GitHub Desktop.

Select an option

Save echu/e392a46f0c67e9ad1a301724137c61c8 to your computer and use it in GitHub Desktop.
# useful bits to remove temp files in shell scripts
FILE=$(mktemp)
function remove_temp_output {
rm $FILE
}
trap remove_temp_output EXIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment