/*
 Simple execlp() demo

 Bill Slough
 MAT 4970

 Experiments:

 1.) Execute as-is.
 2.) Adjust the first argument: /bin/date -> date
 3.) Add arguments to the date command
 4.) Add a variable to save the return value from execlp()
 5.) Mangle the first argument; giving it a bad pathname
 6.) Examine the value of errno, introduce perror()

 */

#include <stdio.h>
#include <unistd.h>
#include <errno.h>

int main() {
    /* Use the list-based exec() to get a new process image */
    execlp("/bin/date", "date", NULL);

    /* Will we reach this statement? */
    printf("Hello, world.\n");
    
    return 0;
}
