From e3d8ee97809fcdfc66dd461b7add91e9411442ff Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 12 Aug 2021 18:27:01 +0200 Subject: [PATCH] modulecmd: bugfix in removing tmp file in _exit --- Pmodules/modulecmd.bash.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index f620f21..fc51ad6 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -143,7 +143,9 @@ save_env() { _exit() { save_env "${g_env_must_be_saved}" - ${rm} -f "${tmpfile}" + if [[ -n "${tmpfile}" ]] && [[ -e "${tmpfile}" ]]; then + ${rm} -f "${tmpfile}" || : + fi } trap '_exit' EXIT