We can have the situation that shell options are already unset, in that case we actually change them to setted. The correct way of preventing shell options overriding is using a subshell, because all the functions that use set are only printing the result the subshell works like a charm.
Also we can remove the resetting of options and env vars at the end of the functions
We can have the situation that shell options are already unset, in that case we actually change them to setted. The correct way of preventing shell options overriding is using a subshell, because all the functions that use
set
are only printing the result the subshell works like a charm.Also we can remove the resetting of options and env vars at the end of the functions