Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hey, just like groovy's "".execute()


Lua has a function called os.execute() where you can call programs and utilities from the command line. Cross platform as well; I've got more than one Lua script where it's working in the command line and can handle being on Unix or on Windows.

A common example of this that I use quite often is "clear" or "cls". It makes the determination what OS it's using, then issues the appropriate command to clear the terminal window.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: