Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    set -o posix, then you have unset is builtin instead of your fucntion, then unset builtin unset command. Commented Nov 10, 2017 at 7:06
  • 1
    @cuonglm, that looks like an answer. Commented Nov 10, 2017 at 7:20
  • 1
    @cuonglm I do hope you post an answer about that, not just so I can upvote it but also because, although I've done my very best to write in such a way as to avoid giving this impression, I fear that--as long as mine is the only answer--a few less careful readers might think the method I've shown is necessary even when readonly is not used. My solution is a hackish curiosity; yours is a real solution that might be used even for reasons other than fun, and that transmits important knowledge about the effects of POSIX mode in Bash. Commented Nov 10, 2017 at 8:06
  • 2
    In bash, you can also do: enable -n builtin unset command enable Commented Nov 10, 2017 at 8:32
  • @StéphaneChazelas, that looks like another way to "hose" any possibility to access builtins. (At a glance I thought it was a way to recover them.) Interesting. Commented Nov 10, 2017 at 8:35