I run a Perl script and try to rename the files as shown below.
I have a list of * .ru.jp files in a folder with other unrelated files. I would like to rename the number that I have as a counter.
In Bash, I would do so ...
for i in $(ls *.ru.jp); do x=${i%%.*}; mv $i "$x"t"$counter".ru.jp ;done
For example, myfile.ru.jp will be renamed to myfilet1.ru.jp if the counter is 1. "t" is just a naming convention, indicating t1, t2 ... etc. And there is an external cycle that will ultimately mean mafilet2.ru.jp, etc. As the counter variable increases.
I would like to know how I could write and present similar ones for a loop like in a Perl script?
Thank.
-joey