From a89e29c6ee8aec55e559f411431108c850533154 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 10 Jan 2012 17:33:09 +0100 Subject: [PATCH] maintain latest symlink for tmpfuncs --- .zsh/zshrc/39_tempfuncs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.zsh/zshrc/39_tempfuncs b/.zsh/zshrc/39_tempfuncs index 4b46a17..79f43dd 100644 --- a/.zsh/zshrc/39_tempfuncs +++ b/.zsh/zshrc/39_tempfuncs @@ -9,8 +9,11 @@ # cdt () { - builtin cd $(mktemp -td ${1:-cdt}.XXXXXX) + local tmpdir + tmpdir=$(mktemp -td ${1:-cdt}.XXXXXX) + builtin cd $tmpdir pwd + ln -sf $tmpdir ${TMPDIR:-/tmp}/cdt.latest } vit () { @@ -31,6 +34,7 @@ vit () { [ -n "$stdin" ] && cat >| $tmpfile sensible-editor $tmpfile /dev/tty echo $tmpfile + ln -sf $tmpfile ${TMPDIR:-/tmp}/vit.latest } # vim:ft=zsh -- 2.39.5