diff options
author | Lars Wirzenius <lwirzenius@wikimedia.org> | 2020-05-15 13:50:58 +0300 |
---|---|---|
committer | Lars Wirzenius <lwirzenius@wikimedia.org> | 2020-05-15 13:50:58 +0300 |
commit | 051426cfd7f8a66a78b02cc34da3f9e2e2372d13 (patch) | |
tree | df99de8b38ff880ea0c32f2fd96f7a5342c810ae /shell-temp.sh | |
parent | 3af2dc7ea57e4f3956090baa8b7596687ea9b90a (diff) | |
download | wmf-talks-051426cfd7f8a66a78b02cc34da3f9e2e2372d13.tar.gz |
Add: talk on shell scripting
Diffstat (limited to 'shell-temp.sh')
-rw-r--r-- | shell-temp.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shell-temp.sh b/shell-temp.sh new file mode 100644 index 0000000..7fd1d52 --- /dev/null +++ b/shell-temp.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +set -eu + +cleanup() { + rm -rf "$tempdir" +} + + +tempdir="$(mktemp -d)" +trap cleanup EXIT + + +echo foo > "$tempdir/foo.txt" +echo "$tempdir" |