0
so i have an array with the following:
  array[0][0] = command arg1 arg2 arg3
  array[1][0] = command
  array[2][0] = command arg1 arg2 arg3 arg4

etc

I want to use execvp to execute each of these lines of commands,
eg.
   execvp(array[0],array);

How could i, within a while loop (so i can get through every row), use fork, so that the child could complete every row of command. Would it be better for me to put my arguments in one array and my arguments in another?

vladimir
  • 13,428
  • 2
  • 44
  • 70
Daniel
  • 31
  • 4
  • duplicate https://stackoverflow.com/questions/27541910/how-to-use-execvp ? – vladimir May 10 '19 at 00:53
  • stackoverflow.com is not a free code design/coding site. Post what you have tried and why it is different from what you expected. I.E. post a [mcve] then we can help you – user3629249 May 12 '19 at 06:47
  • There are LOTS of examples of how to do this on stackoverflow.com. Strongly suggest you perform a bit of research – user3629249 May 12 '19 at 06:48

0 Answers0