Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2008-12-31 20:26:32
Size: 550
Editor: GreyCat
Comment:
Revision 3 as of 2009-02-24 21:19:19
Size: 831
Editor: GreyCat
Comment: category tag
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
 .../bash-3.2$ CC=whatever ./configure
 .../bash-3.2$ make
 .../bash-3.2$ exec ./bash
 .../bash-3.2$ cd examples/loadables/
 .../loadables$
.../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
Line 13: Line 15:
The rest is going to require a machine with `dlopen()` apparently. :( 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]]

----
CategoryShell

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, usually from within 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.0-shl.diff


CategoryShell

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