invoke a command in the host operating system - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : System : External Functions : system

system - invoke a command in the host operating system

Calling Sequence









sequence of strings, and/or small integers



The function system passes command to the host operating system which performs the appropriate function.


The result is the return status of the command performed, which is operating system dependent, but usually 0 indicates success and any other value indicates failure.


Note: On some operating systems, some operating system commands may not be accessible via this mechanism.


The function system[launch] spawns a new process before executing command via Windows' CreateProcess or Unix-style fork/exec system calls.  The given command should specify an application or executable file, not a shell or DOS command.


The new process, as specified by command and zero or more arguments, is started outside Maple.  The Maple process continues as usual; it does not wait for the new process to finish.


If an error occurs trying to start the new process, system[launch] may not report any messages as to the cause of the error.


The specified executable file is searched for in the same set of directories as commands entered on the system command line (as set by the PATH environment variable).


system[launch] will return the process id of the spawned process.

Thread Safety


The system command is thread-safe as of Maple 15.


For more information on thread safety, see index/threadsafe.


systemecho test

test 0


systemlaunchxterm,-title,My Title

See Also

escape, kernelopts/system, option for ``option system'', ssystem, Threads

Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam