Hi,
I am running a Perl script and try to accomplish renaming files as below..
I have a list of *.ru.jp files in a folder with other non related files. I would like to rename with a number which I have got as a counter variable.
In Bash,I would do as ...
for i in $(ls *.ru.jp); do x=${i%%.*}; mv $i "$x"t"$counter".ru.jp ;done
E.g myfile.ru.jp would be renamed as myfilet1.ru.jp if the counter is 1. "t" is just a naming to indicate t1,t2...etc. And there is an outer loop above all which eventually will label mafilet2.ru.jp and so on as the counter variable increases.
I would like to know how could I write and represent similar for loop as in Perl script?
Thanks.
-joey