title: bash script pass enter [return] key to another script initiated through ssh heredoc
body: <p>I've run into an issue with a script I'm creating. It copies some data over to another server and then connecting to the server using an ssh heredoc it starts a second script located on the second server inside the heredoc. </p>
  
  <p>The issue I've run into is that if you execute this second script through the bash script (as opposed to manually starting it) then it will skip a crucial step where the second script asks you to hit [enter] and then type in a password to generate some files. </p>
  
  <p><a href="https://i.stack.imgur.com/Zlfo9.png" rel="nofollow noreferrer">enter</a></p>
  
  <p><a href="https://i.stack.imgur.com/2IpJi.png" rel="nofollow noreferrer">password</a></p>
  
  <p>I don't have access to this second script so I can't change anything. I've tried all types of echo | ./script2.sh combos, printf, heredoc, and nothing works. Edit: expect is not available on this second server.</p>
  
  <p>example of what I'm doing:</p>
  
  <pre><code>scp -r $dir xxxx@xxx.xx.x.xx:/as/df/qwerty/
  
  ssh xxxx@xxx.xx.x.xx "bash -s" &lt;&lt; EOF
  # install
  /as/df/qwerty/${choice}/./install_${choice}
  EOF
  </code></pre>