SYSTEM(S) UNIX System V SYSTEM(S)
Name
system - issue a shell command
Syntax
#include <stdio.h>
int system (string)
char *string;
Description
The system function causes the string to be given to sh(C)
as input, as if the string had been typed as a command at a
terminal. The current process waits until the shell has
completed, then returns the exit status of the shell.
Files
/bin/sh
See Also
exec(S), sh(C)
Diagnostics
The system function forks to create a child process that in
turn exec's /bin/sh in order to execute string. If the fork
or exec fails, system returns a negative value and sets
errno.
Standards Conformance
system is conformant with:
AT&T SVID Issue 2, Select Code 307-127;
The X/Open Portability Guide II of January 1987;
and ANSI X3.159-198X C Language Draft Standard, May 13,
1988.
(printed 6/20/89)