Lua Bash: Run Lua as a Bash loadable
freshmeat.net
freshmeat.net
The reason Rene Rebe wrote luabash initially was to speed up certain shell scripts without drastic rewriting of existing code, efficiency being the main justification for dynamic loadables (which came from ksh) in the first place.
The code here is simple, and I enjoyed reading it: it lit a few lights for me about how to use Bash loadables.
local ffi = require("ffi")
ffi.cdef[[
int printf(const char *fmt, ...);
]]
ffi.C.printf("Hello %s!", "world")