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