I have a java class file which I need to run on every file in a directory. I'm currently using the following command to run the program on every file in the directory
find . -type f -exec java JavaProgram {} \;
However instead of displaying the result in the terminal, I need it to output the result of each call to a separate file. Is there a command I could use that can recursively call a java program on a whole directory and save the terminal output of each call to a separate file?
Sort of like running java JavaProgram inputfile > outputdir/outputfile
but recursively through every file in a directory where 'inputfile'
and 'outputfile'
have the same name.