title: Delete file from SFTP server using sftp protocol in shell script
body: <p>I'm new to shell scripting. I'm trying to delete a file from a remote server using <code>SFTP</code> protocol. Though I'm able to download the file, but I'm unable to delete post download. This is my code:</p>
  
  <pre><code>sftp -oPort=22 $FTP_USER@$FTP_SVR:$TEST_PATH/TEST_*.dat.gpg $LAND
     if [ $? -ne 0 ]; then
        Error "Cannot Download TEST file from SFTP Server"
     fi
  
  sftp -oPort=22 $FTP_USER@$FTP_SVR:$TEST_PATH/n rm TEST_*.dat.gpg
  if [ $? -eq 0 ]; then
    echo "Removing TEST Files from SFTP Server"
  fi
  </code></pre>