title: In Turtle, how do I take stdout from a program, process it, and then supply something to stdin?
body: <p>I am currently playing with format string attacks in C. I have a toy program that prints (to <code>stdout</code>) the address of a variable that I want to access, then accepts a line from <code>stdin</code> and <code>printf</code>s it..</p>
  
  <p>Using Turtle, I'd like to be able to:</p>
  
  <ul>
  <li>execute the program</li>
  <li>parse the first few lines of <code>stdout</code> to retrieve the address</li>
  <li>using the address, craft a format string for <code>printf</code> (I know how to do this bit)</li>
  <li>write the attack string to <code>stdin</code></li>
  </ul>
  
  <p>However, I can't see how to do this. Using a function like <code>inshell :: Text -&gt; Shell Line -&gt; Shell Line</code>, I can supply some lines to <code>stdin</code> and get back a stream from <code>stdout</code>. However, I don't know how to inject new lines to <code>stdin</code> <em>after</em> having read a couple of lines from <code>stdout</code>.</p>