- Jun
- 223
- 0
I often use a - self-written - Perl script that renames files according to some complex condition. It is called like so:
FOR %i IN (*.pdf) rename.pl "%i"
At times it may happen that a file "abc.pdf" (e.g.) is renamed to "xyz.pdf" (e.g.). This renamed file would then be again - and unwantedly - processed by the loop as it newly appears in FOR's list of files (aka the directory).
Is there a way to have FOR use a static list of files as compared to its - obviously - dynamic one? I found no clue in the docs so far.
I know, I could change my Perl script and have IT iterate over directory...
FOR %i IN (*.pdf) rename.pl "%i"
At times it may happen that a file "abc.pdf" (e.g.) is renamed to "xyz.pdf" (e.g.). This renamed file would then be again - and unwantedly - processed by the loop as it newly appears in FOR's list of files (aka the directory).
Is there a way to have FOR use a static list of files as compared to its - obviously - dynamic one? I found no clue in the docs so far.
I know, I could change my Perl script and have IT iterate over directory...