I have a set of files in a directory
test1.in
test2.in
test3.in
test4.in
...
I have written a conversion tool to extract some data from those files and save it into another file.
I want to run that conversion tool for each file and save the results into different output files
./tool -i test1.in -i test1.out
./tool -i test2.in -o test2.out
I have seen a lot of answer to iterate on the files and run the desired command for each file, but I am not sure how to specify the output.
for file in dir/*.in; do
./tool -i file -o ???
done
How can I create a name for the output file?