Differences between revisions 4 and 7 (spanning 3 versions)
Revision 4 as of 2011-12-19 17:45:17
Size: 1083
Editor: ppp089210037252
Comment: moar links
Revision 7 as of 2020-04-25 02:18:36
Size: 1132
Editor: c-73-202-78-216
Comment: Update link to dead article
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from BashLoadable
Line 3: Line 4:
Loadable builtins must be compiled for your system, usually from within the bash source tree: Loadable builtins must be compiled for your system. Some are included as examples in the bash source tree:
Line 15: Line 16:
This requires a platform which bash knows how to support for loading shared objects/libraries. On most systems, bash supports this using the `dlopen()` function. If you're on older versions of HP-UX, there is a patch by GreyCat: [[attachment:bash-4.0-shl.diff]] This requires a platform which bash knows how to support for loading shared objects/libraries. On most systems, bash supports this using the `dlopen()` function. If you're on older versions of HP-UX, there is a patch by GreyCat: [[attachment:bash-4.2-shl.diff]] (older version: [[attachment:bash-4.0-shl.diff]]).
Line 17: Line 18:
A bit more of info can be found here: A bit more info can also be found at:
Line 19: Line 20:
* http://cfajohnson.com/shell/bash/loadables/ and in the linked article http://cfajohnson.com/shell/articles/dynamically-loadable/

These builtins can also been found as examples in the bash source tarball
 * http://cfajohnson.com/shell/bash/loadables/
* https://web.archive.org/web/20160303032434/http://cfajohnson.com/shell/articles/dynamically-loadable/

BASH has the ability to load compiled modules to create new commands which interface with the operating system more directly than can be achieved by calling external commands. These are called loadable builtins.

Loadable builtins must be compiled for your system. Some are included as examples in the bash source tree:

.../bash-4.0$ CC=whatever ./configure
.../bash-4.0$ make
.../bash-4.0$ exec ./bash
.../bash-4.0$ cd examples/loadables/
.../loadables$ make
.../loadables$ enable -f finfo finfo
.../loadables$ help finfo

This requires a platform which bash knows how to support for loading shared objects/libraries. On most systems, bash supports this using the dlopen() function. If you're on older versions of HP-UX, there is a patch by GreyCat: bash-4.2-shl.diff (older version: bash-4.0-shl.diff).

A bit more info can also be found at:


CategoryShell

BashLoadableBuiltins (last edited 2020-04-25 02:18:36 by c-73-202-78-216)