I've got a bunch of files called oldabc, olddef etc.
i want to copy these to be abc, def....
I can do this with file extensions....but can get the logic to work for prefixes. All the files I am interested in have a prefix of 'old'.
This loop is no good for me....it looks at the content of the files...rather than changing the filename.
for files in `ls *fmt`;
do
newfilename="cut -c4-50 $files";
cp $files $newfilename;
done
How do I get it to look at the filename and change it - rather than the content of the file?