Running shell script from java code and pass arguments

前端 未结 4 1610
走了就别回头了
走了就别回头了 2020-12-12 04:40

I am executing a shell script from Java program. I have implemented it using Runtime class. Below is the code I implemented

final StringBuilder sb = new Stri         


        
4条回答
  •  天命终不由人
    2020-12-12 05:10

    Your approach is correct you just need to add a space (" ") before parameters and escape the "/" and " " characters in the parameters

提交回复
热议问题