bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call dynamic builtins with 'builtin' command


From: Greg Wooledge
Subject: Re: Call dynamic builtins with 'builtin' command
Date: Wed, 9 Oct 2024 07:23:32 -0400

On Wed, Oct 09, 2024 at 15:15:52 +0400, Vadim Nevorotin wrote:
> According to 'help enable' this should work, but it also do not:
> 
> $ enable stat
> $ enable -n stat
> $ builtin stat
> bash: builtin: stat: not a shell builtin
> 
> 'enable -n' should just disable stat, according to 'help enable', but
> it looks like it also removes it.

I'm really confused about what you think "disable" means.  If you disable
a builtin, that means you can no longer call it.

hobbit:~$ enable -n cd
hobbit:~$ cd /tmp
bash: cd: command not found

Not even if you prefix it with "builtin".

hobbit:~$ builtin cd /tmp
bash: builtin: cd: not a shell builtin

So, the loadable builtins are behaving consistently with the regular
builtins here.  Seems correct to me.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]