Hello Guest it is April 27, 2024, 10:47:59 AM

Author Topic: LUA issue operating system command  (Read 426 times)

0 Members and 1 Guest are viewing this topic.

Offline Rimmel

*
  •  208 208
    • View Profile
LUA issue operating system command
« on: May 30, 2022, 07:43:57 AM »
Is there a way to get the lua to issue an operating system command. e.g. start another program?

thank you
Re: LUA issue operating system command
« Reply #1 on: May 30, 2022, 07:52:40 PM »
Hi,
you really like to to tackle the hard stuff don't you?

https://www.lua.org/manual/5.3/manual.html#6.9

Code: [Select]
os.execute ([command])
This function is equivalent to the ISO C function system. It passes command to be executed by an operating system shell. Its first result is true if the command terminated successfully, or nil otherwise. After this first result the function returns a string plus a number, as follows:

"exit": the command terminated normally; the following number is the exit status of the command.
"signal": the command was terminated by a signal; the following number is the signal that terminated the command.
When called without a command, os.execute returns a boolean that is true if a shell is available.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'