title: How to get exit code from remote machine using sshpass command
body: <p>I want to list the files on the remote machine using bash script without entering password.</p>
  
  <p>I am using following command to do it</p>
  
  <pre><code>sshpass -p password ssh user@ubuntusite.net  "ls /usr/local/"
  </code></pre>
  
  <p>I want to get the exit code from the above command to know my command (ls /usr/local) fails or get passed.</p>
  
  <p>How to do it? Kindly help me</p>