|
|
coherent
system() General Function system()
Pass a command to the shell for execution
iinntt ssyysstteemm(_c_o_m_m_a_n_d_l_i_n_e) cchhaarr *_c_o_m_m_a_n_d_l_i_n_e;
system passes _c_o_m_m_a_n_d_l_i_n_e to the shell sshh, which loads it into
memory and executes it. ssyysstteemm executes commands exactly as if
they had been typed at the COHERENT command level. system may be
used by commands such as ed, which can pass commands to the
COHERENT shell in addition to processing normal interactive re-
quests.
***** Example *****
This example uses ssyysstteemm to list the names of all C source files
in the parent directory.
#include <stdio.h>
main()
{
system("cd .. ; ls *.c > mytemp; cat mytemp");
}
***** See Also *****
exec, fork(), general functions, popen(), wait
***** Diagnostics *****
ssyysstteemm returns the exit status of the child process, in the for-
mat described in wait: exit status in the high byte, signal in-
formation in the low byte. Zero normally means success, whereas
nonzero normally means failure. This, however, depends on the
command. If the shell is not executable, system returns a
special code of octal 0177.
COHERENT Lexicon Page 1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.