Change file extension taking in from a variable

Viewed 501

I have this variable:

input_file = file.csv

I want to change the extension of this file from file.csv to file.old

I was thinking about something like mv $input_file basename $input_file . old but I don't really know how to do it

3 Answers
Related