title: Get the return code of a C program in my shell program
body: <p>Suppose I have a C program named <code>Foo.c</code> which is printing few things and returning a value named <code>rc</code> which I am executing in my shell program as follows :</p>
  
  <p><code>foobar=$(Foo | tail -1)</code></p>
  
  <p>Now, the variable foobar has the last printed value of the program <code>Foo</code>. But without disturbing this, I want to get the return code <code>rc</code> of the program in my shell program.</p>