issue a shell command
int system(const char string);
system causes the string to be given to a command shell
as input, as if it had been typed as a command at a terminal.
system forks to create a child process
that runs the command shell specified in the SHELL
environment variable in the current environment; this shell executes
If SHELL is not set, then /bin/sh is used.
The current process waits until the shell has
completed, then returns the exit status of the shell.
for a description of the information
packed into the exit status.
If string is a NULL pointer, system checks if
the shell specified in the SHELL environment variable
exists and is executable.
If it is available, system
returns non-zero; otherwise it returns zero.
If the fork or exec of string fails,
system returns -1 and sets errno.
If the command interpreter cannot
be executed then it behaves as if exit(127) or
_exit(127) had been called.
system fails if one or more of the following are true:
The system-imposed limit on the total number of processes under execution by
a single user would be exceeded.
The new process requires more memory than is allowed by the system-imposed
Previous versions of UnixWare and SCO OpenServer always used /bin/sh as
the shell in which command is executed.
Applications built for previous system versions may require that
SHELL be set to /bin/sh in the caller's environment.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004