如何在Linux平台上运行.testssl.sh命令并将输出保存在Json文件中以及如何将Json数据保存在数据库中

时间:2019-03-05 09:04:38

标签: java json

我在桌面上克隆了testssl.sh的git存储库 使用克隆,我想在Linux平台上运行以下命令,并将输出保存到.json文件,读取文件并将json数据保存到数据库。

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

下面是到目前为止我尝试过的代码

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);
}

无法执行的命令无法执行,但是在我运行时它正在传递。

0 个答案:

没有答案