Recently Written · git

tmpl

Insanely simple templates

git clone https://github.com/equwal/tmpl

Log | Files | Refs


sh/trap/cleanup-multiple (201 bytes)

1 # Clean up multiple temporary files/directories
2 tmpdir=$(mktemp -d)
3 tmpfile1=$(mktemp)
4 tmpfile2=$(mktemp)
5 
6 cleanup() {
7     rm -rf "$tmpdir" "$tmpfile1" "$tmpfile2"
8 }
9 trap cleanup EXIT
10 
11 # carry on
12 <++>