diff --git a/setup_rsmodules.csh b/setup_rsmodules.csh index 55deee8..2d27fa3 100644 --- a/setup_rsmodules.csh +++ b/setup_rsmodules.csh @@ -20,6 +20,9 @@ if ( -f ~/.rsmodules_autoload ) then source ~/.rsmodules_autoload endif +# cleanup old tmp files from crashed rsmodules sessions +find ~/.rsmodulestmp* -mtime +1 -exec rm -f {} \; >& /dev/null + # this should be a function, so everytime it is called the info is updated set mod_av="`$RSMODULES_INSTALL_DIR/rsmodules noshell avail`" diff --git a/setup_rsmodules.sh b/setup_rsmodules.sh index 528289e..35a5557 100644 --- a/setup_rsmodules.sh +++ b/setup_rsmodules.sh @@ -23,6 +23,9 @@ if [ -f ~/.rsmodules_autoload ]; then source ~/.rsmodules_autoload fi +# cleanup old tmp files from crashed rsmodules sessions +find ~/.rsmodulestmp* -mtime +1 -exec rm -f {} \; 2> /dev/null + if [ ${BASH_VERSINFO:-0} -ge 3 ]; then # # Bash commandline completion (bash 3.0 and above)