Shell: Sed -i.bak to rename file by appending current date Shell: Sed -i.bak to rename file by appending current date shell shell

Shell: Sed -i.bak to rename file by appending current date


Since we have date "+%m%d%y" that returns MMDDYY (month day year):

$ date "+%m%d%y"071913

What about saying sed -i.$(this command) so you have the following?

sed -i.$(date "+%m%d%y") -r .... file