Hi Benjamin,
do you think that the code below could do what you need?
The shell function "mylua" works like "lua", but after running the Lua
interpreter it executes the shell commands stored in /tmp/to.sh in the
current shell context... Hint: if "source" looks unfamiliar, see:
function mylua () {
echo -n > /tmp/to.sh
lua $*
source /tmp/to.sh
}
# Test:
mylua -e '
toshell = function (str)
f = assert(io.open("/tmp/to.sh", "w+"))
f:write(str)
f:close()
end
toshell("cd /tmp/")
'
Cheers,
Eduardo