title: fork multiple child processes to run other programs
body: <p>I want from parent program (called daemon) to start 5 child processes of test program with args(all 5 in parallel, not to wait to finish).</p>
  
  <p>I have the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  
  int main(int argc,char* argv[]){
  
      //missing irrelevant part where argum is set
  
      int status,i;
      char cmd[512];
      pid_t process_id = 0;
      for (i=0; i&lt;=5;i++)
      {
          process_id = fork();
          if (process_id &lt; 0)
          {
              printf("fork failed - %d!\n",i);
              continue;
          }
          else if(process_id &gt; 0) {
              printf("process_id of child process %d \n", process_id);
          }
          else
          {
              sprintf(cmd,"./test %s",argum);
              status = system(cmd);
              exit(0);
          }
      }
      return 0;
  }
  </code></pre>
  
  <p>it starts them but when I run ps -aux to see the processes, besides the good ones (like: ./test [args]) there are some duplicates like: sh -c ./test [args] </p>
  
  <p><em><strong>How can I get rid of those starting with "sh -c" ?</em></strong></p>