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
funnily enough, you already said the builtin name -- command
$ var="FOO"
$ unset() { echo nope; }
$ echo "${var}"
FOO
$ unset var
nope
$ echo "${var}"
FOO
$ command unset var
$ echo "${var}"
this doesn't help if you're in a hostile environment where someone has created a command() { :; }
function. but if you're in a hostile environment, you've already lost ;).
when it comes to exporting functions into the environment, that's a bash-specific extension and you should not really rely on that. POSIX shells (like dash) do not support that by design.