title: Compiling and executing c program in bash script not working because the compiled program is not found
body: <p>I only recently started programming. I have a shell script which contains a c-program. At the end of the script, the c-program is ran using the commands</p>
  
  <pre><code>gcc stadist.c -lm 
  a.out &lt; XXXXX | sort -n -k3 &gt; YYYYY 
  rm a.out 
  rm stadist.c 
  rm XXXXX 
  </code></pre>
  
  <p>Running this script gives a.out: not found. The file YYYYY is created but it is empty. How can i solve this problem. I am on Linux ubuntu 16.04 LTS.</p>