#include #include /* for chdir and execlp */ /* Simple exec example code - this becomes ls -al */ int main() { /* change current working directory to / */ chdir("/"); /* run ls -al using execlp */ if (execlp("ls","ls","-al",NULL)) { perror("Huh?"); } return(0); /* only gets here is execlp failed! */ }