system

system --  treats its argument as a system command.

Syntax

system (command_line)

		

Arguments

command_line

A string.

Returns

A numerical return code as generated by the operating system.

Description

This function treats its argument as a command to be run in the native operating system. This function will wait until the command completes before returning with the command's exit status. In UNIX and QNX 4, the command may be run in the background by using an & symbol after the command_line argument.

Example

    Gamma> system("ps");
     PID TTY          TIME CMD
    7856 pts/4    00:00:00 bash
    8335 pts/4    00:00:00 Gamma
    8336 pts/4    00:00:00 ps
    0
    Gamma> system("ls *ty*");
    li_type.c  li_type.o  privity.c  pty.lsp
    0
    Gamma> system("mysubtask &");
    0
    		

See the Starting qserve and nserve section of the Common Functions chapter (Tutorial One), or the Linux or QNX section of the Abstracted Functions chapter in the Cogent Tools Demo and Tutorials book for examples of this function used in context.

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.