I'm trying to take a txt file and "mv" it to a XML file, adding the date prior to the extension. I've got variables to display the date in the correct format. The original filename will will be "ccs45_?.txt" where ? can be any one or two-digit number.
This code moves this ccs45_1.txt into this ccs45_[0-9]_061120.xml
How can I keep the original filename intact (up to the extension) when moved into the filename with the date.newextension?
Code:
filename=ccs45_[0-9]
mv $DATA_DIR/$filename.txt $DATA_DIR/${filename}_$y$m$d.xml
This code moves this ccs45_1.txt into this ccs45_[0-9]_061120.xml
How can I keep the original filename intact (up to the extension) when moved into the filename with the date.newextension?