I have a folder in my server which contains some files. These are automated that means everyday we get new files automatically which will overwrite the old ones.
So want to take
path_src=./folder1
path_dst=./folder2
date=$(date +"%m%d%y")
for file_src in $path_src/*; do
file_dst="$path_dst/$(basename $file_src | \
sed "s/^\(.*\)\.\(.*\)/\1$date.\2/")"
echo mv "$file_src" "$file_dst"
done