Headlines
Loading...
Program in UNIX rename which will rename files in the current directory according to the following arguments: suffix to be replaced

Program in UNIX rename which will rename files in the current directory according to the following arguments: suffix to be replaced

Write the BASH shell script rename which will rename files in the current directory according to the following arguments: suffix to be replaced 
      The script should rename each matching regular file or symbolic link in the current directory by replacing the file name suffix with replacement suffix. For example: 
rename a.txt  a.text
      will rename the file a.txt to a.text. However, no overwriting of existing files nor     renaming of the special directories . and .. is allowed. 

for i in `ls *.txt`
do
    fname=`basename $i txt`
    mv $i ${fname}text
done
*** PLEASE checkout the Best deals from for top sites like Amazon, Flipkart etc ***