title: running screen command from a c program
body: <p>Here is the part of code I have written to stuff 0 to a screen session open in one of my Ubuntu terminal tabs.</p>
  
  <pre><code>char command[60];
  strcpy( command, "screen -S 8305.pts-1.MYUb  -X stuff $'0'" );
  system(command);
  </code></pre>
  
  <p>It gets compiled fine with only a warning like
  </p>
  
  <pre class="lang-none prettyprint-override"><code>ignoring return value of ‘system’,
  </code></pre>
  
  <p>But when it comes to running it does nothing regarding the screen command. Before this, I was getting "No screen session found." error which was fortunately solved by asking about it <a href="https://stackoverflow.com/questions/28100830/can-not-connect-to-an-already-active-screen-through-system-in-c/28101250#28101250">here</a>.</p>
  
  <p>I have tried <code>system()</code> with other shell commands and it works perfectly fine. The command for screen also works fine when you run it in a terminal session not in c code.</p>