[Solved] How do i execute shell script using java
This is a simple code to execute the shell script and read its output: import java.io.*; public class Test { public static void main(String[] args) throws Exception { String[] command = { “./flows.sh”, “suspend” }; Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader(new InputStreamReader( process.getInputStream())); String s; while ((s = reader.readLine()) != null) { … Read more