I mean I want to use unset that is not a shell function itself. If I could do that, I could make sure that command is pure by running
This is what I know what can be done...
#!/bin/bash --posix
# if e.g. BASH_FUNC_unset() env variable is set, script execution cannot
# get this far (provided that it is run as is, not as `bash script ...`)
unset -f builtin command declare ...
saved_IFS=$IFS; readonly saved_IFS
# remove all functions (shell builtin declare executed in subshell)
IFS=$'\n'; for f in `declare -Fx`; do unset -f ${f##* }; done; IFS=$saved_IFS