mode = ScriptMode.Verbose
exec("ping")
exec("ping www.google.com")
exec("ping", "")
exec("ping", "www.google.com")
Only the calls 3 and 4 are executed, but in both cases without the command line options (so it prints the ping manual).
From a look in the source, in calls 1 and 2 the proc rawExec is executed – which simply does nothing. In calls 3 and 4, the proc staticExec is called, which executes the command but the arguments are not propagated. The only way working is echo(staticExec("ping www.google.com")), but that seems as a hack.
As it seems the forum will prevent "long" postings, my additional questions:
Does exec not work on Windows systems? Why are two different exec procs used for the same command (with and without arguments)?