aboutsummaryrefslogtreecommitdiff
path: root/bin/mktd
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-03 11:36:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-03 11:37:53 +1200
commit1161cf8eb9f21ffcc3be539f1ec3b7e4a7d3e395 (patch)
treea1828b4686656dcc9c56e8905c60e77287297a05 /bin/mktd
parentAdd issue regarding mktemp(1) usage (diff)
downloaddotfiles-1161cf8eb9f21ffcc3be539f1ec3b7e4a7d3e395.tar.gz
dotfiles-1161cf8eb9f21ffcc3be539f1ec3b7e4a7d3e395.zip
Add mktd(1)
Diffstat (limited to 'bin/mktd')
-rwxr-xr-xbin/mktd5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/mktd b/bin/mktd
new file mode 100755
index 00000000..657ec31f
--- /dev/null
+++ b/bin/mktd
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Try to make a random temp directory
+dn=${TMPDIR:-/tmp}/${1:-mktd}.$$.$(rndi 1 2147483648)
+mkdir -m 700 -- "$dn" || exit 1
+printf '%s\n' "$dn"