fp=popen(cmd,"r")
fgets(buffer, sizeof(buffer), fp);
strncmp(buffer, "success", strlen("success"))
---------------------------------------------------
pid = vfork();
if (pid == 0)
execl("/bin/sh", "sh", "-c", cmd, (char*)0)
else
while(waitpid(pid, &status, 0) < 0)
......
要调用wait来等待子进程的返回值
进程管道