hi I have a directory with files names like ABC20090101AXY.txt, ABC20090102BZ.txt,ABC20090101COF.txt etc. The digits in the filenames represent the date. I want to rename the files to AXY.txt, BZ.txt and COF.txt
I tried with this code.
myfile= date '+ABC%Y%m%d'
for i in *.txt
do
mv $i `echo $i | sed 's/$myfile//'`
done
But its giving message
mv: ABC20090101AXY.txt and ABC20090101AXY.txt are identical