July 2018
Beginner
202 pages
5h 42m
English
One of the things that makes Lua powerful as a scripting language is its ability to interact with the operating system through a shell/terminal. os.execute takes a string and returns a status code. Whatever the provided string is will be executed as a shell command. The return value is whatever the running program returned.
If Lua is running embedded in a program, or is on an OS with no shell/terminal, the os.execute command will return 0. You can test if the current Lua environment has a shell by calling os.execute with no arguments. If a non-zero value is returned, a shell is available. If zero is returned, there is no shell or terminal.
The code here tries to pull from git. Using os.execute, Lua could be used ...