He's trying to parse command line arguments, if I'm not mistaken. He is also overlooking the basics of passing arguments to functions, unless this is somehow supposed to be a replacement for it? toks = gettoks();
There is not reason to make a separate function to get the arguments since they are right there to begin with. You just need to loop through them.
So yea, it's supposed to work like a command line shell. The first parameter in execl is supposed to be const char *pathname. What I need to know is how to get the user input and pass it to that first parameters in execl.