Thank you for the quick fix, this seems to resolve the immediate blocking issue. However it seems 'unset -f' still has problems.
I updated my example case slightly and found while 'unset -f' won't block later commands if the function is not set, it will still do so when the function is previously set. I have attached the updated example which will fail with. 9: echo: can't find function definition file Note that there is also a nasty memory link if the function name references the command inside the function. echo () echo foo; } echo The attached example uses 'printf' instead to avoid this.
posh_unset2.sh
Description: application/shellscript