From 4e505c23c6f2ca140bcd92e169c72b1ab916ac1a 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..8777dd3 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 "${1:-tmp}.XXXXXXXX")"; } alias svi=sudoedit alias svim=sudoedit