its to do with the way environment variables are being "stripped" out when you call up the subshell.
you need to setup some simple tests like say
test.sh
Quote:
echo $PATH > /mnt/us/path.txt
|
if that is empty then you have your answer, the subshell strips it.
it would also explain why putting the values IN a shell script AFTER you call the -c would work, as you are setting them "after" the stripping
and luakit isn't "missing" them, in the original context it didn't need them. but with the altered environment call it does.
There was some switch " su --preserve-environment -c" on a linux box to convince an su subshell to maintain the calling environment, It doens't apply here though (since you cant su anyways)
but it demonstrates a solution to a similar problem and what an answer might might be. Stripped environment in subshells.
test test test. set up simple tests. only way to know for sure.