Ok, if it works on Windows there is something else causing the problem.
Specifically what I'm trying to do is run a separate murgaLua process that runs a new script using a variable created in the current script. This is what I have working in Linux:
io.popen(MURGALUA.." -e 'images=\""..images.."\"' "..tempfile)
MURGALUA is the murgaLua executable
tempfile is a dynamically created script file
images is a Lua variable being passed, which is a directory that tempfile wouldn't be able to find otherwise.
If I recall correctly, I got a "bad symbol" error in Windows.
This also works in Linux, but I haven't yet tested in Windows:
io.popen(MURGALUA..[[ -e 'images="]]..images..[["' ]]..tempfile)
Maybe there is a problem with the string being interpreted first for io.popen and then being misinterpreted when it's run. It might end up being sent in this format:
lua -e 'var="string"' -- works on Linux but not on Windows
If that's the case, I think it might be a problem with using a backslash escape after all.
It looks like one option could be something like this:
io.popen(MURGALUA..' -e "images=\"'..images..'\"" '..tempfile)
which I hope would run this command:
murgaLua -e "images=\"<images path>\"" <new script>
However, I could see it doing this instead:
murgaLua -e "images="<images path>"" <new script>
which I guess would probably also fail.
Perhaps the best solution would be
io.popen(MURGALUA..[[ -e "images=']]..images..[['" ]]..tempfile)
which is essentially the same as the second one above but with the single and double quotes swapped, hopefully resulting in this:
murgaLua -e "images='<images path>'" <new script>
That one looks like it should work in Windows.