Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Overriding "builtin"



On Fri, Aug 12, 2022, at 3:57 AM, Stephane Chazelas wrote:
> On 2022-08-12 08:12, Daniel Shahaf wrote:
> [...]
>> «unset 'functions[unfunction]'», provided (zsh/parameter is available
>> and) someone hasn't created an unset() function as well.
> [...]
>
> Or the standard "unset -f builtin"
>
> Or functions=()
>
> (or exec zsh -f)
>
> Or
>
> builtin() {
>    echo my builtin wrapper
>    set -o localoptions -o posixbuiltins
>    command builtin "$@"
> }

Or ''unhash -f builtin''.

I (perhaps overzealously) interpreted the original question as
asking for a method that is impervious to interference from *any*
function (and maybe alias?) definition.  But if you've broken your
shell so hard that *none* of these suggestions works, then, as they
say in the IRC channel, you get to keep the pieces.

-- 
vq




Messages sorted by: Reverse Date, Date, Thread, Author