Использование BufferedReader
кажется простым подходом.
import java.io.*;
import java.util.stream.*;
. . .
Process p = Runtime.getRuntime().exec("/usr/bin/open -a Terminal script.sh");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
// perhaps retrieve all the lines as a stream for future processing
// i.e. map, filter, reduce, etc.
Stream<String> lines = input.lines();
// or go line by line from the BufferedReader
String line;
while ((line = input.readLine()) != null) {
// do something with line
}
// To just retrieve all the output as a single String
String output = input.lines().collect(Collectors.joining("\n"));
. . .
input.close()