title: shell script to download latest file from FTP
body: <p>I am writing shell script first time, I want to download latest create file from FTP.
  I want to download latest file of specific folder. Below is my code for that. But it is downloading all the files of the folder not the latest one.</p>
  
  <pre><code>ftp -in ftp.abc.com &lt;&lt; SCRIPTEND
  user xyz xyz
  binary
  cd Rpts/
  mget ls -t -r | tail -n 1
  quit
  SCRIPTEND
  </code></pre>
  
  <p>help me with this, please?</p>