title: How to simulate two consecutive ENTER key presses for a command in a bash script?
body: <p>[EDITED]
  It can be considered as an extension to [this question][1].
  <code>echo | command</code> 
  The above command can be used to supply one 'ENTER' character to the command's first input request.</p>
  
  <p>How can i supply the next 'ENTER' character to the same command in its second input request.</p>
  
  <p>Please comment if any other details are required.</p>
  
  <p>Am giving the specific example which i want to implement.
  I need to run <code>SSH-keyGen</code> commmand in my shell script.
  It will ask for following inputs:</p>
  
  <ol>
  <li>Enter the target file name</li>
  <li>Enter the pass phrase</li>
  <li>Enter the pass phrase again</li>
  </ol>
  
  <p>How can we pass these three inputs to the command?</p>
  
  <p>I tried with,</p>
  
  <pre><code>echo -ne "\n \n"| ssh-keygen  //which is passing two new lines for the first input request only.
  </code></pre>
  
  <p>and
  <code>echo -ne "\n"|(echo -ne "\n"|ssh-keygen)// but still no positive result</code></p>
  
  <p>Note: Am avoiding the input file name request in the above two command, just to make the things simple</p>