title: how to check if a host is in your known_host ssh
body: <p>I have the following command works in my script that adds the host to the known hosts in ssh.</p>
  
  <pre><code>VAR2=$(expect -c '
   spawn ssh -o StrictHostKeyChecking=no '"$REMOTE_HOST_USER@$REMOTE_HOST_IP"'
   expect "*?assword:*"
   send "'"$REMOTE_HOST_PASSWD"'\r"
   expect { 
   "Permission denied, please try again." {
   exit '"$WRONG_PASSWORD"' 
   }
   }
   ')
  </code></pre>
  
  <p>Works fine, but I need to control before the command if the host is already in known_hosts and not execute command if it is already in known_hosts. How can i check if an host is in known_hosts?</p>