Hello All,
I want to change date part in file name to yesterday date in the file name.
example file name
file-12122017-06-30-41.dat
want
file-12112017-06-30-41.dat
I am doing like below. Below it is not changing the filename. Actually it is not parsing the $today and $yesterday value in replacing part.
yesterday=`date +%m%d%Y -d "1 day ago"`
today=`date +%m%d%Y`
find . -name "*$today-*" -exec bash -c 'mv $0 ${0/"$today"/"$yesterday"}' {} \;
Kindly help on this.