Sample Unix exec code. The programs here use one of the exece functions (there are six!) to run new progams. Keep in mind that when exec is called (and everything goes right), it never returns, as the process that calls exec is replaced with the new program. These programs were developed on FreeBSD (and Linux). The minishell program uses readline, on the CS BSD machines you need to make sure you compile with the OPTIONS turned on in the Makefile (this is how it is by default). To build the minishell under Linux, just comment out the OPTIONS line in the Makefile (put a '#' at the beginning fo the line). Files: execls.c: simple example of exec, uses execlp to run "ls -al" in / execv.c: another simple example, this one uses execvp to run "ls -al" in / execcmdline.c: reads command line arguments and builds a new command from them, which it then execs. minishell.c: a simple shell that handles only commands with no command line arguments. So it will run "ls", but not "ls -al". Uses readline to prompt for a line from the user, then forks and the child execs the new command. Parent process (the minishell) waits for the child to terminate before handling the next line. Hit ^D on a line by itself to terminate the minishell.