I am writing a program using execl to execute my exe file which is testing and it\'s work very well and display the output in the Linux CLI. But I have not idea how to chang
In order to see the difference between execl and execv, here is a line of code executing a
ls -l -R -a
execl("/bin/ls", "ls", "-l", "-R", "-a", NULL);
char* arr[] = {"ls", "-l", "-R", "-a", NULL};
execv("/bin/ls", arr);
The array of char* sent to execv will be passed to /bin/ls as argv (in int main(int argc, char **argv)
)
Here is the execl(3) Linux manual page for more detail.