Author Topic: System command  (Read 2058 times)

Rick3137

  • Guest
System command
« on: June 02, 2013, 06:23:06 PM »
 I have been doing a study of EGSL and I got stuck with the system() command. How does that work?

Tomaaz

  • Guest
Re: System command
« Reply #1 on: June 02, 2013, 10:18:58 PM »
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: June 02, 2013, 10:24:39 PM by Tomaaz »

Rick3137

  • Guest
Re: System command
« Reply #2 on: June 02, 2013, 10:25:45 PM »
 Thanks Tomaas.  How do you do one like system("cmd") ?

Tomaaz

  • Guest
Re: System command
« Reply #3 on: June 02, 2013, 10:36:40 PM »
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: June 02, 2013, 10:38:30 PM by Tomaaz »

Rick3137

  • Guest
Re: System command
« Reply #4 on: June 02, 2013, 11:21:17 PM »
 Command line programs, don't always work right. The window programs work fine. Oh well. Not important. Thanks.