I am using below command to execute a shell script from java. I also need to check if script execution is successful without any errors. Is there any possible method to do this? Please advise.
ProcessBuilder pb = new ProcessBuilder("test.sh", arg1, arg2);
Process p = pb.start();