title: How to use tee with sshpass in shell script
body: <p>I have a situation that I need to append several lines(ip and hosts) from a file to /etc/hosts.</p>
  <p>If I execute the below command</p>
  <blockquote>
  <p><strong>sshpass -p password cat /tmp/hosts |sudo tee -a  /etc/hosts</strong></p>
  </blockquote>
  <p>I am getting</p>
  <blockquote>
  <p>sudo: no tty present and no askpass program specified.
  Sorry, try again.</p>
  <p>sudo: no tty present and no askpass program specified. Sorry, try again.</p>
  <p>sudo: no tty present and no askpass program specified. Sorry, try again.</p>
  <p>sudo: 3 incorrect password attempts</p>
  </blockquote>
  <p>Any alternatives to this?</p>