title: How to deal with "Pseudo-terminal will not be allocated because stdin is not a terminal."
body: <pre><code>ssh -t remotehost vim /tmp/x.txt
  </code></pre>
  
  <p>I know that I can run a command like the above.</p>
  
  <p>But I would like to be able to run any local bash code in a remote machine. For this reason, I'd like to call the remote 'bash -s' so that can process any local bash code.</p>
  
  <pre><code>ssh -t remotehost 'bash -s' &lt;&lt;&lt; vim /tmp/x.txt
  </code></pre>
  
  <p>However, the above example shows "Pseudo-terminal will not be allocated because stdin is not a terminal." Is there any way to let ssh take local bash code via stdin and run it via the remote 'bash -s'? Thanks.</p>