[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Call dynamic builtins with 'builtin' command
From: |
Vadim Nevorotin |
Subject: |
Call dynamic builtins with 'builtin' command |
Date: |
Wed, 9 Oct 2024 15:15:52 +0400 |
Hello!
I'm trying to do a very simple task: I want to use the 'stat' builtin
from BASH_LOADABLES_PATH without overwriting the current behavior of
the 'stat' command in the current shell (whether it's a binary from
$PATH, or an alias, or a function).
This does not work:
$ builtin stat
bash: builtin: stat: not a shell builtin
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.
So:
1. At least the help for 'enable' should be fixed, but there is
definitely a bug in enable+builtin usage for dynamic builtins.
2. Can you explain how to load and use e.g. stat builtin without
overwriting the current behavior of stat in the whole existing script?
Thanks,
Vadim
- Call dynamic builtins with 'builtin' command,
Vadim Nevorotin <=