cis-lclient06:~/class/nov22>more one.c #include #include main() { printf("This is program one\n"); close(1); exit(0); } cis-lclient06:~/class/nov22>gcc -o one one.c cis-lclient06:~/class/nov22>more exec3.c #include #include #include int main(void) { execl("one", (char *) NULL); printf("Only get here if execl() fails\n"); } cis-lclient06:~/class/nov22>gcc exec3.c cis-lclient06:~/class/nov22>./a.out This is program one cis-lclient06:~/class/nov22>man 3 execv NAME execl, execlp, execle, execv, execvp - execute a file SYNOPSIS #include extern char **environ; int execl(const char *path, const char *arg, ...); int execlp(const char *file, const char *arg, ...); int execle(const char *path, const char *arg, ..., char * const envp[]); int execv(const char *path, char *const argv[]); int execvp(const char *file, char *const argv[]); DESCRIPTION The exec() family of functions replaces the current process image with a new process image. The functions described in this manual page are front-ends for execve(2). (See the manual page for execve(2) for further details about the replacement of the current process image.) ... q cis-lclient06:~/class/nov22>man 2 execve NAME execve - execute program SYNOPSIS #include int execve(const char *filename, char *const argv[], char *const envp[]); DESCRIPTION execve() executes the program pointed to by filename. filename must be either a binary executable, or a script starting with a line of the form: #! interpreter [optional-arg] For details of the latter case, see "Interpreter scripts" below. ... q cis-lclient06:~/class/nov22>