Skip to main content
added 87 characters in body
Source Link
muru
  • 77.9k
  • 16
  • 212
  • 318

The filename must be an "absolute" pathan "absolute" path (in this context, that's just a path with a slash in it), or it will be looked up in BASH_LOADABLES_PATH, falling back to dlopen(3)'s search mechanism (e.g., see the Linux manpage). It seems that, despite the comments in enable.cenable.def, these do not include the current directory (which is a good thing, IMO).

Just use a path:

bash-5.0$ enable -f print print
bash: enable: cannot open shared object print: print: cannot open shared object file: No such file or directory
bash-5.0$ enable -f ./print print
bash-5.0$ help print
print: print [-Rnprs] [-u unit] [-f format] [arguments]
    Display arguments.
    
    Output the arguments.  The -f option means to use the argument as a
    format string as would be supplied to printf(1).  The rest of the
    options are as in ksh.

The filename must be an "absolute" path (in this context, that's just a path with a slash in it), or it will be looked up in BASH_LOADABLES_PATH, falling back to dlopen(3)'s search mechanism (e.g., see the Linux manpage). It seems that, despite the comments in enable.c, these do not include the current directory (which is a good thing, IMO).

Just use a path:

bash-5.0$ enable -f print print
bash: enable: cannot open shared object print: print: cannot open shared object file: No such file or directory
bash-5.0$ enable -f ./print print
bash-5.0$ help print
print: print [-Rnprs] [-u unit] [-f format] [arguments]
    Display arguments.
    
    Output the arguments.  The -f option means to use the argument as a
    format string as would be supplied to printf(1).  The rest of the
    options are as in ksh.

The filename must be an "absolute" path (in this context, that's just a path with a slash in it), or it will be looked up in BASH_LOADABLES_PATH, falling back to dlopen(3)'s search mechanism (e.g., see the Linux manpage). It seems that, despite the comments in enable.def, these do not include the current directory (which is a good thing, IMO).

Just use a path:

bash-5.0$ enable -f print print
bash: enable: cannot open shared object print: print: cannot open shared object file: No such file or directory
bash-5.0$ enable -f ./print print
bash-5.0$ help print
print: print [-Rnprs] [-u unit] [-f format] [arguments]
    Display arguments.
    
    Output the arguments.  The -f option means to use the argument as a
    format string as would be supplied to printf(1).  The rest of the
    options are as in ksh.
Source Link
muru
  • 77.9k
  • 16
  • 212
  • 318

The filename must be an "absolute" path (in this context, that's just a path with a slash in it), or it will be looked up in BASH_LOADABLES_PATH, falling back to dlopen(3)'s search mechanism (e.g., see the Linux manpage). It seems that, despite the comments in enable.c, these do not include the current directory (which is a good thing, IMO).

Just use a path:

bash-5.0$ enable -f print print
bash: enable: cannot open shared object print: print: cannot open shared object file: No such file or directory
bash-5.0$ enable -f ./print print
bash-5.0$ help print
print: print [-Rnprs] [-u unit] [-f format] [arguments]
    Display arguments.
    
    Output the arguments.  The -f option means to use the argument as a
    format string as would be supplied to printf(1).  The rest of the
    options are as in ksh.