I have to make a C program in Unix that parses user input to check for valid Unix commands and executes them using exec(). I have completed the parser function and its working perfectly fine for the four commands that I have to make it for. For the exec() part, I looked up and found the execl() to be pretty good but the trouble with it is that since we have to define the directory to call it, we can use a command like "ls" but when a switch is added to it like "ls -a", a string containing this command cannot be used with execl(), as only ls library will be called at a time! Can anyone suggest a good exec() variation for this purpose, which simple executes a given string in the program in Unix? Thanks!