title: Checking if a directory exists on another server in ksh
body: <p>I am trying to verify if a directory exists prior to moving a file in Korn, using the classic:</p>
  
  <pre><code>    if [[ -d ${dir} ]]; then
          scp file
      else
          exit 12
      fi</code></pre>
  
  <p><strong>My Problem:</strong> <br/> That the directory is on another server, so whenever I check, the script can't find it and therefore fails and exits every time. <br/>
  <strong>My Question:</strong> <br/> Is there a way to do a "-d" across the network, perhaps using sftp/scp-like functionality? The user currently does not have to enter a password and can scp fine, so that is one less issue.</p>