up previous next
SystemCommand    --    run a system command


Syntax
SystemCommand(CMD: STRING): INT

Description
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 (i.e. a shell command on Linux platforms). The string CMD is passed to the underlying system command line interpreter for execution; and the exit code from the command line interpreter is returned as an integer.

Example
/**/ ExitCode := SystemCommand("echo abc");
abc
shellcommand line interfaceclisystem cmd