title: Recursive FTP directory listing in shell/bash with a single session (using cURL or ftp)
body: <p>I am writing  a little shellscript that needs to go through all folders and files on an ftp server (recursively). So far everything works fine using cURL - but it's pretty slow, becuase cURL starts a new session for every command. So for 500 directories, cURL preforms 500 logins.</p>
  
  <p>Does anybody know, whether I can stay logged in using cURL (this would be my favourite solution) or how I can use ftp with only one session in a shell script?</p>
  
  <p>I know how to execute a set of ftp commands and retrieve the response, but for the recursive listing, it has to be a little more dynamic...</p>
  
  <p>Thanks for your help!</p>