up previous next
SystemCommand --
run a system command
|
SystemCommand(CMD: STRING): INT |
This function will work only if the CoCoA interpreter was started with
the "enable system command" flag set; by default the flag is not set
since system commands can be used maliciously (e.g. to delete files).
This function expects a string containing a "system command" (e.g. a
shell command on Linux platforms). The string
CMD is passed to the
underlying operating system command line interpreter for execution.
The return value of
SystemCommand depends on the platform (i.e. the
C++ run-time environment), so should not be relied upon to provide
any specific information: e.g. on some Linux systems the value returned
is the exit code, on others it is 256 times the process exit code.
/**/ ExitCode := SystemCommand("echo abc"); --> value of ExitCode is unclear
abc
|