/*
 * This pointer array will be
 * used as the arguments to
 * the execv* programs.
 */
char *argv[] = {
	"/bin/mail",
	"mail",
	"root",
	0,
}

/*
 * This array will be used as the environment
 * for the exec*e programs.
 */
char *envp[] = {
	"PATH=:/bin:/usr/bin:/usr/ucb:/usr/local",
	"USER=user",
	"TERM=adm3a",
	0,
}

/*
 * In all cases here, we are executing /bin/mail, and sending
 * mail to user "root".  See Examples 14 and 15 for detail on 
 * how a program might actually do this.
 */

/*
 * The simplest forms.
 */
execl("/bin/mail", "mail", "root", 0);

execv(argv[0], argv);

/*
 * These two search the path
 * for the program, thus they
 * don't need a path as an argument.
 */
execlp("mail", "mail", "root", 0);

execvp("mail", argv);

/*
 * These two take their last argument 
 * as the environment.
 */
execle("/bin/mail", "mail", "root", 0, envp);

execve(argv[0], argv, envp);
