/* A quick example using execl and execlp to demonstrate the difference */ /* Run it to screen, and then redirect to file. Is the output different? */ #include #include main() {if (vfork()==0) { /* Use vfork to force child to go first */ printf("No Path Search - Full display\n"); execl("/bin/ls","/bin/ls","-l",NULL); } else { printf("Path Search - Wide Display\n\n"); execlp("ls","ls",NULL); /* Try this call without the p in execlp */ } }