From d9cf0684cd2314839fdc71522907e0f9cb4cb98f Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 27 Jul 2022 13:42:21 +0200 Subject: [PATCH] modulecmd: unalias issue in sub-cmd purge fixed --- Pmodules/modulecmd.bash.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index b4a2035..cad2c56 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -754,7 +754,7 @@ subcommand_unload() { local arg for arg in "${args[@]}"; do local output=$("${modulecmd}" "${Shell}" 'unload' "${arg}") - eval "$(echo "${output}"|sed -e 's/;unalias [^;]*//g')" + eval "$(echo "${output}"|${sed} -e 's/;unalias [^;]*//g')" case ${Shell} in sh | bash | zsh ) echo "${output}" @@ -1922,8 +1922,8 @@ subcommand_purge() { "${error_txt}" fi if [[ "${Shell}" == "sh" ]]; then - # for sh-like shells just echo - echo "${output}" + # for sh-like shells just echo + eval "$(echo "${output}"|${sed} -e 's/;unalias [^;]*//g')" else # re-run with right shell "${modulecmd}" "${Shell}" 'purge'