Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

execve(2)

wait(2)

popen(3)

system(3)

Name

system − issue a shell command

Syntax

system(string)
char *string;

Description

If the string argument is the NULL pointer (0) the system function tests the accessibility of the command interpreter sh(.). The function will return zero for failure to find the command interpreter, and positive if successful.

If the string argument is non-NULL the system routine causes the string to be given to sh() 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 in the form that wait() returns.

Diagnostics

Exit status 127 indicates the shell couldn’t be executed. 

See Also

execve(2), wait(2), popen(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026