i just had a bad experience with os.execute() see i was working on a bunch of bugs in my data graphing script that collects data from an imu connected to an arduino, and then graphs it out in an opengl canvas. its one of those linear algebra problems that ive long since figured out that there is no getting my head around it, i just have to try every possible combination of maths till it works. needless to say i got tired of tabbing through my lua files so that i could run the main wlua file (which is needed for gui applications). so in the file i was working on i scrolled down to the bottom and added this code:
if not runthings then
runthings = true
os.execute ("imu")
end
i hit that run button hoping that my script file (which contains nothing but my graphing "class") will run, then get to that thing at the bottom and launch the actual app so i can remove two mouse clicks from my work flow. it seems obvious now that this doesnt work. that damn runthings variable gets lost somewhere (right at the end of the file when it launches a new interpreter instance), and i end up getting a runaway loop of my lua script launching new instances of itself. ive *****ed about lua's memory hoggyness before, and it didnt take long for the system to eat every scrap of system memory available. i was scrambling trying to kill them before the machine locked up, i managed to force a reboot. this is a sure sign that ive had enough programming for one day, time for sleep actual (though knowing me im going to reboot my system 50 times trying to pass the runthings variable to the new instance). im actually convinced that most viruses during the 90s where the hacker's failed attempts at programming something useful.