www.pudn.com > shell.rar > work2.c
#includemain() { int pid1,pid2; while((pid1=fork())==-1) printf("creat first process error!!"); if(pid1==0) { system("ls -l | grep '^-' | wc -l"); } else { while((pid2=fork())==-1) printf("creat second process error!!"); if(pid2==0) { system("ls -l | grep '^-' "); } else { printf("\nchild processes are completed\n"); exit(1); } } }