I have written a code to move my file from one directory to another directory, the file is in .csv format and i need to append a current date to the file. the prolem is date is getting appended after the file extension..
here is my code :
cd /data/home/abc/xyz
now=$(date +"%m_%d_%Y")
for file in name.csv
do
mv "${file}" /data/home/abc/xyz/azher/backup/"${file}_$now"
done
am getting output as name.csv_1_30_2014 but i want to display it as name_1_30_2014.csv
Hi guys am trying to download a file from server, wen i give the file name to download as file.csv , curr date should get appended to that, i tried with the previous code itself but am getting some error in that, am not getting the file extension