#include #include /* for execvp */ #include /* for malloc */ /* Another exec example code - this uses argv (from the command line). We must build a new array of arguments (otherwise we would tell exec to exec this program (recursivly and infinitely...) */ int main(int argc, char **argv) { char **newargs; int i; /* allocate enough memory for new array of pointers */ newargs = malloc(sizeof(char *) * argc); /* copy all but the first pointer */ for (i=1;i