help-bash
[Top][All Lists]
Advanced

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

Re: Behavior of "enable foo" doesn't seem to match bash(1) page.


From: Chet Ramey
Subject: Re: Behavior of "enable foo" doesn't seem to match bash(1) page.
Date: Fri, 16 Aug 2024 15:25:57 -0400
User-agent: Mozilla Thunderbird

On 8/16/24 12:14 PM, Ti Strga wrote:
Yeah, I know, it's a bit obscure.

The man page documentation for 'enable' ends with:

enable [-a] [-dnps] [-f filename] [name ...]
      Enable and disable builtin shell commands.
      [...]
      If no options are supplied and a name is not a shell builtin, enable
      will attempt to load name from a shared object named name, as if
      the command were ‘‘enable ‐f name name .

(It's missing the closing quote marks, but that's not my question.)

Trying this on a recent Ubuntu installation:

      $ enable cut
      -bash: enable: cut: not a shell builtin

This is on ubuntu 24 on an AWS VM.

ubuntu@ip-172-29-1-101:~$ echo $BASH_LOADABLES_PATH
/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:.
ubuntu@ip-172-29-1-101:~$ ls /opt/local/lib/bash
ls: cannot access '/opt/local/lib/bash': No such file or directory
ubuntu@ip-172-29-1-101:~$ ls /usr/pkg/lib/bash
ls: cannot access '/usr/pkg/lib/bash': No such file or directory
ubuntu@ip-172-29-1-101:~$ ls /opt/pkg/lib/bash
ls: cannot access '/opt/pkg/lib/bash': No such file or directory
ubuntu@ip-172-29-1-101:~$ ls /usr/local/lib/bash
ls: cannot access '/usr/local/lib/bash': No such file or directory
ubuntu@ip-172-29-1-101:~$ ls /usr/lib/bash
ls: cannot access '/usr/lib/bash': No such file or directory
ubuntu@ip-172-29-1-101:~$ uname -a
Linux ip-172-29-1-101 6.8.0-1009-aws #9-Ubuntu SMP Fri May 17 14:39:23 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ip-172-29-1-101:~$ enable cut
-bash: enable: cut: not a shell builtin

so it appears that none of the directories in the default Ubuntu value of
BASH_LOADABLES_PATH actually exist. I don't know where they're installed,
if anywhere, and I didn't bother to search beyond these.

Even with explicitly setting BASH_LOADABLES_PATH appropriately, the
"if no options, assume -f" behavior doesn't seem to be kicking in.

I built bash-5.2.32 myself, in a private build directory, and this script

BASH_LOADABLES_PATH=~/build/bash-5.2.32/examples/loadables:.
enable cut
type cut

prints

cut is a shell builtin

so I don't think it's a problem with bash.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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