I have a large list of files:
i18n/
editor.utf8
editor_fr.utf8
editor_ko.utf8
editor_ge.utf8
...etc. (dozens of these)
I would like to run a utility, let's call it fizzbuzz
, that takes as its program arguments an "input file" and an "output file". An example of invoking it would be:
fizzbuzz editor.utf8 editor.properties
or:
fizzbuzz editor_fr.utf8 editor_fr.properties
Hence, for each invocation, I want the input file to be a different file under i18n/
, and I want the output file to be a file of the same name, but with a different file extension (.properties
). If the output/properties file already exists, it should get totally overwritten.
How could I script things so that I can run fizzbuzz
on each .utf8
file in i18n/
, and for each of those files, specify an output with the same name, just a .properties
file?
My best attempt thus far:
for FILE in i18n
do
fizzbuzz FILE FILE.properties
done
Just creates a lone FILE.properties
file.
find
in combination withexec
, there are lots of questions on similar topics already. – Panki Jul 08 '19 at 13:29$
is key here) – Panki Jul 08 '19 at 13:45