Problem: I need to find out today's date and search a file which contain's today's date in the name. Also another file which contains Yesterday's date. I was able to do so by something like:
TODAY=$(date +"%m%d%Y")
YESTERDAY=$(date --date="yesterday" +"%m%d%Y")
SNAPSHOT=SnapshotIR${YESTERDAY}\*.csv
for snapshotfile in $SNAPSHOT
do
if [ -f "$snapshotfile" ]
then
SNAPSHOTFOUND="$snapshotfile"
echo Snapshot Report $SNAPSHOTFOUND is available
But there is a condition here that, if today is Monday I have to check one file which has last Friday's date and another file which has Saturday's date in their names unlike Today and Yesterday.
Can anyone suggest.