title: How to detect on waiting for user input from bash script?
body: <p>My bash script looks like: </p>
  
  <pre><code>read -p "Do you wish to continue?" yn
  # further actions ...
  </code></pre>
  
  <p>And I just want to interact with this script using nodejs / child_process. 
  How can I detect that it's waiting for the user input? </p>
  
  <pre><code>var spawn = require('child_process').spawn;
  var proc = spawn('./script.sh');
  proc.stdout.on("data", function(data) {
    console.log("Data from bash");
  }
  proc.stdin.on("data", function(data) {
    console.log("Data from bash"); // doesn't work :/
  }
  </code></pre>
  
  <p>Thank you!</p>