Home:ALL Converter>Writing a bash script to run a java program

Writing a bash script to run a java program

Ask Time:2016-06-28T07:31:43         Author:user6461129

Json Formatter

I'm rank new to bash thus the question. I've a java program that I've exported as a .jar. This file when run as

java -jar somefile.jar

goes into an infinite loop and awaits a file name. Based on the correct file path it generates an output.

How do I write a bash script to do automated testing of this project. I need the scrip to do the following -

Run the program, which is run the same command
provide an array of 5 files as an input to the program
For each file write the output to an log file.

Author:user6461129,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38064801/writing-a-bash-script-to-run-a-java-program
yy