I am writing a lua script and I have to execute two shell commands that both keep echo-ing information until terminated with ^C.
This means os.execute is useless since it waits for the return code, which never comes, and freezes the entire script. Do you have any idea on how to make this work? A good solution is not to require os.execute to return any value so it will send the command and move on but I think this is not possible. Another is multithreading that I haven’t been able to make it work whatsoever.
I also must have the ability to somehow stop both infinite-loops by either using ^C or a lua method. The script is running on iPhone (iOS 5.0.1 / root) using Lua 5.1.4.
That should run the command in the background and return to your Lua script immediately.
If you want more sophisticated process control, you’re probably going to want to write that in native code.