Java exec() does not return expected result of pipes' connected commands

后端 未结 6 533
傲寒
傲寒 2020-12-11 05:58

I\'m calling command line programs connected by pipes. All this works on Linux for sure.

My method:

protected String execCommand(String command) thro         


        
6条回答
  •  有刺的猬
    2020-12-11 06:00

    Still didn't found proper solution to execute piped commands with Runtime.exec, but found a workaround. I've simply wrote these scripts to separate bash files. Then Runtime.exec calls these bash scripts and gets expected result.

提交回复
热议问题