Please be more specific about you file names, what you wrote is confusing. Is the name of files actually "Dir-20111114-xyz"? Or, is part of that trying to show path and name, as in "\dir\2011114\xyz"?
the Directory name is actually "DIR-20111114-xyz" and there is 50 or so with "DIR-20111114-abc" "DIR-20111114-efg"
I want to keep the name intact except for the changing of the date.
OLDDATE=20111114
NEWDATE=yyyymmdd
for DIR in DIR-"${OLDDATE}"-*
do
sed "s/${OLDDATE}/${NEWDATE}/g" < "${DIR}/config.xml" > "${DIR}/config.xml.new"
#cat "${DIR}/config.xml.new" > "${DIR}/config.xml"
# rm "${DIR}/config.xml.new"
echo mv "${DIR}" "${DIR/${OLDDATE}/${NEWDATE}}"
done
Remove the #'s and echoes once you've checked the output and the content of the config.xml.new files to make sure it's really done what you want.