I have a folder of files that will be modified daily. I'm trying to have a passes script condition find the file with the basename that matches the current month and day. I will then take an action on that file.
File names are:
01-05.html
05-03.html
11-15.html
07-16.html
...
assuming today is July 16th (month 07), I should match the bottom file.
I've tried numerous iterations but cannot get a match to occur. Here's the latest iteration:
today=`date +%m`"-"`date +%d`
if [ "$(basename "$1")" == "$today" ]; then exit 0; else exit; fi
Any help is greatly appreciated, thank you.