title: Pseudo-terminal will not allocated because stdin is not a terminal & mess: ttyname failed: Inappropriate ioctl for device
body: <p>I've written a shell script to scp, ssh, delete a directory, unzip, and remove the zip file</p>
  
  <pre><code>#!/bin/bash
  
  tar -czf zipfile.tar.gz ./* .??*
  scp zipfile.tar.gz root@some.ip.address:/var/www/html/wp-content/themes
  rm zipfile.tar.gz
  
  ssh root@some.ip.address &lt;&lt; 'ENDSSH'
  cd /some/directory
  rm -rf zipfile
  mkdir zipfile
  tar xf zipfile.tar.gz -C zipfile
  rm zipfile.tar.gz
  ENDSSH
  
  </code></pre>
  
  <p>I am noticing that the files are successfully transferred and unzipped.  The zip file is also successfully removed from the server.
  However, I notice that I'm receiving these messages in the terminal</p>
  
  <pre class="lang-sh prettyprint-override"><code>zipfile.tar.gz  100% 224KB ...
  Pseudo-terminal will not be allocated because stdin is not a terminal.
  ...
  Welcome to Ubuntu 18.04.3 LTS...
  ...
  
  0 packages can be updated.
  0 updates are security updates.
  
  mesg: ttyname failed: Inappropriate ioctl for device
  </code></pre>
  
  <p>Running the script before the second block (ENDSSH) seems to not output those messages and executes successfully.</p>
  
  <p>Is the <code>ENDSSH</code> causing the issue?</p>