From 051426cfd7f8a66a78b02cc34da3f9e2e2372d13 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 15 May 2020 13:50:58 +0300 Subject: Add: talk on shell scripting --- shell-temp.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 shell-temp.sh (limited to 'shell-temp.sh') 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" -- cgit v1.2.1