diff --git a/.hunspell.en.dic b/.hunspell.en.dic index 506bd486..a99eefd5 100644 --- a/.hunspell.en.dic +++ b/.hunspell.en.dic @@ -846,6 +846,7 @@ txt ubuntu umask un +unalias uname uncomplete undef diff --git a/NEWS.rst b/NEWS.rst index a1f049c8..7e9fc394 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -116,6 +116,10 @@ Modules 5.4.0 (not yet released) sub-commands. * Lib: slightly adapt code of Modules Tcl extension library to properly build against Tcl 9.0. +* Adapt alias unset shell code for *sh*-kind shells to avoid errors when alias + to unset is not defined. +* Adapt function unset shell code for *sh*-kind shells to avoid errors when + function to unset is not defined. .. _5.3 release notes: diff --git a/tcl/envmngt.tcl.in b/tcl/envmngt.tcl.in index 74c17336..d03c6656 100644 --- a/tcl/envmngt.tcl.in +++ b/tcl/envmngt.tcl.in @@ -353,7 +353,7 @@ proc renderSettings {} { lappend g_shcode_out "unalias $var;" } sh { - lappend g_shcode_out "unalias $var;" + lappend g_shcode_out "unalias $var 2>/dev/null || true;" } fish { lappend g_shcode_out "functions -e $var;" @@ -386,7 +386,8 @@ proc renderSettings {} { del { switch -- [getState shelltype] { sh { - lappend g_shcode_out "unset -f $funcname;" + lappend g_shcode_out "unset -f $funcname 2>/dev/null ||\ + true;" } fish { lappend g_shcode_out "functions -e $funcname;"