title: return code of system()
body: <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdio.h&gt;
  
  int main() {
  
  int res = system("ps ax -o pid -o command | grep sudoku | grep gnome &gt; /dev/null");
  
  printf("res = %d \n", res);
  
  return 0;
  }
  </code></pre>
  
  <p>I want to see if <code>sudoku</code> is running or not by just examining the return code of <code>system()</code> (or any other call for that matter). I do not want any output to be printed anywhere.</p>
  
  <p>I do not quite understand the return code of <code>system()</code> even after looking at the <a href="http://pubs.opengroup.org/onlinepubs/009604499/functions/system.html" rel="noreferrer">man page</a></p>
  
  <p>Whether <code>sudoku</code> is running or not, I get <code>res = 0</code>.</p>