#include#include #include int main(int argc,char *argv[]) { pid_t pid; //進(jìn)程標(biāo)識符 printf("**This is a test for exec series fun**\n"); //打印提示符 if(fork()==0) //創(chuàng)建一個子進(jìn)程 { execl("/bin/date","/bin/date",(char*)0); //使用execl函數(shù)調(diào)用date命令 exit(0); //退出 } else { sleep(1); //主進(jìn)程休眠 execl("/bin/time","/bin/time",(char*)0); } exit(0); }