runtime.exec - how to invoke sh file in linux terminal using Runtime.getRuntime().exec in java -


how invoke sh file in linux terminal using runtime.getruntime().exec in java ?

i want invoke sh file in new terminal java code. if run in terminal runs separate process, not closed if programs exits. , thats why i'm not using processbuilder, stops process invoked if program using exits.

if script marked executable (chmod +x script.sh), can invoke exec("./script.sh"). otherwise can directly call using exec("sh script.sh").


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -