I'm new to this, but I've been asked to write a bash script to SFTP a file from one server to another. The bash script will be run 4 times per day using CRON, just after the file below has been created. The client's website creates XML files containing orders 4 times per day. Each file is given a new name, with an incremental number. For example:
a_file-01.xml
b_file-01.xml
a_file-02.xml
b_file-02.xml
a_file-03.xml
b_file-03.xml
How can I find the newest file (which will also have the highest number)?