Each day an application creates a file called file_YYYYMMDD.csv
where YYYYMMDD
is the production date. But sometimes the generation fails and no files are generated for a couple of days.
I'd like an easy way in a bash or sh script to find the filename of the most recent file, which has been produced before a given reference date.
Typical usage: find the last generated file, disregarding those produced after the May 1st.
Thanks for your help