title: About stdout/stderr redirections
body: <p>I wrote a code to get a runtime error intentionally:</p>
  
  <pre><code>int main()
  {
   int a=5;
   printf("Hello World\n");
   printf("a=%s\n", a);
  }
  </code></pre>
  
  <p>It gives:</p>
  
  <pre><code>$ ./error.o
  Hello World
  Segmentation Fault
  $
  </code></pre>
  
  <p>Now, to record the runtime errors, I do:</p>
  
  <pre><code>$ ./error.o &gt; so.txt
  $ ./error.o &amp;&gt; soe.txt
  </code></pre>
  
  <p>But both the files are empty. Why?</p>
  
  <p>EDIT:</p>
  
  <p>I'm actually writing a script for remote compilation and execution of a c program. From the answers I get that <code>Segmentation Fault</code> is not the program's error output. So, is there a way to capture that output? Also, the program is just a sample, so I can't add the statements. Can line-buffering be done any other way with redirections?</p>