I have a java class file that I need to run for every file in a directory. I am currently using the following command to run a program for each file in a 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 that I could use that can recursively call a java program in the whole directory and save the terminal output of each call to a separate file?
It looks like a launch java JavaProgram inputfile > outputdir/outputfile, but recursively through each file in the directory, where 'inputfile'they 'outputfile'have the same name.
source
share