I want to move all .XML files in the current working directory whose name starts with DAPRETAIL followed by the current date in YYYYMMDD format to a separate directory.
I tried:
DATE='date +%Y%m%d'
mv DAPRETAIL${DATE}*.XML /some/destination
But it returns a: mv: cannot stat 'date +%Y%m%d' error.
date=$(...)in place ofDATE='...'and"$date"in place of${DATE}.