I need to first get the data a file was uploaded to the sftp server on, then check whether it was today's date and if so download it else echo File not found. I would like to do all this using a bash script. This is what I have so far: SFTP> cd testSFTP> get myfile* SFTP> exit today=`date +%Y%m%d`ls -lt | less |head 1 | awk '{print $7,$8,$9}' > $filedateif ($filedate == $today)    echo Today's fileelse     echo Today's file not foundfiUsing the script above, I am always getting Today's file not found even if the file has today's date.
How to Download the latest file from SFTP server?
scripting;sftp