1

I cloned git repository of testssl.sh on my desktop Using the clone, i want to run below command on Linux platform and save the output to a .json file and read the file and save json data to a database.

./testssl.sh -p -s -f -U -S -P --jsonfile-pretty=mxtest.json https://www.google.com

Below is the piece of code i have tried so far

public void test1() throws IOException {
    String sURL = "https://www.google.com";
    runScript("/testssl.sh -p -s -f -U -S -P --jsonfile-pretty=mxtxt.json "+ sURL);
}

public void runScript(String command) throws IOException {

    Runtime rt = Runtime.getRuntime();
       Process proc = rt.exec(command);
}

Unable command is unable to execute but when i run it is passing.

FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79
vectyvec
  • 197
  • 1
  • 12
  • Have you tried to use your command as `./testssl.sh`, did your sh file is with `chmod +x` ? – felipekm Jun 16 '20 at 15:13
  • A shell script won't run. You must run the shell with your script as parameter. https://www.netjstech.com/2016/10/how-to-run-shell-script-from-java-program.html – PeterMmm Jun 30 '20 at 06:08

0 Answers0