From c1f65fc03dee4be3b8f99955d0baa136625570e7 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Tue, 25 May 2021 11:01:14 +0000 Subject: [PATCH] aliases: replace cdt alias with function This adds an optional argument to `cdt` to allow specifying the temporary directory prefix instead of the default `tmp`. This also shortens the random character string from 10 (GNU mktemp) to 8. Signed-off-by: Joe Groocock --- aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases b/aliases index 8398c6e..b1122ae 100644 --- a/aliases +++ b/aliases @@ -35,7 +35,7 @@ alias al=la # No, I don't need the Mono Assembly Linker alias md='mkdir -p' alias rd='rmdir -p' alias -- -='cd -' -alias cdt='cd `mktemp -d`' +cdt() { cd "$(mktemp -d -t "${1:-tmp}.XXXXXXXX")"; } alias svi=sudoedit alias svim=sudoedit