if (pid == 0) {
// Child
execl("/bin/ls", "ls", "-l", NULL);
printf("This will NEVER run\n");
} else {
// Parent
wait(NULL); // block parent and wait for child and throw away exit status
printf("Child finished\n");
}
Anyone else relates to this program? As long as they're happy am I right?