Author Topic: System command  (Read 1021 times)

Rick3137

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Rick's Programs
System command
« on: 02. June 2013, 20:23:06 »
 I have been doing a study of EGSL and I got stuck with the system() command. How does that work?
http://rb23.yolasite.com  Ricks Programs
http://rb27.synthasite.com   Sight and Sound

Tomaaz

  • Guest
Re: System command
« Reply #1 on: 03. June 2013, 00:18:58 »
You can start an external program with it or execute system command. Undel Linux this

Code: [Select]
system("mkdir EGSL")

will create a new directory named "EGSL" in a current directory.

This

Code: [Select]
system("firefox")

will start Firefox browser (of course, if it's installed) and wait till the browser is closed before continue. It does the same job os.execute() in Lua does.
« Last Edit: 03. June 2013, 00:24:39 by Tomaaz »

Rick3137

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Rick's Programs
Re: System command
« Reply #2 on: 03. June 2013, 00:25:45 »
 Thanks Tomaas.  How do you do one like system("cmd") ?
http://rb23.yolasite.com  Ricks Programs
http://rb27.synthasite.com   Sight and Sound

Tomaaz

  • Guest
Re: System command
« Reply #3 on: 03. June 2013, 00:36:40 »
Do you mean cmd.exe on Windows? I'm not that familiar with using console on Windows, but from this topic it looks like os.execute() uses cmd.exe by default. Sorry, if this is not what you're asking about. :)
« Last Edit: 03. June 2013, 00:38:30 by Tomaaz »

Rick3137

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Rick's Programs
Re: System command
« Reply #4 on: 03. June 2013, 01:21:17 »
 Command line programs, don't always work right. The window programs work fine. Oh well. Not important. Thanks.
http://rb23.yolasite.com  Ricks Programs
http://rb27.synthasite.com   Sight and Sound