aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/scr.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/scr.sh')
-rw-r--r--sh/shrc.d/scr.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/shrc.d/scr.sh b/sh/shrc.d/scr.sh
new file mode 100644
index 00000000..255b9322
--- /dev/null
+++ b/sh/shrc.d/scr.sh
@@ -0,0 +1,6 @@
+# Create a temporary directory and change into it, to stop me putting stray
+# files into $HOME, and making the system do cleanup for me. Single optional
+# argument is the string to use for naming the directory; defaults to "scr".
+scr() {
+ cd -- "$(mktd "${1:-scr}")"
+}