Anonymous
public text v1 · immutableProcess cmdProc = null;
try {
cmdProc = Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
throw new RuntimeException(e);
}
BufferedReader in = new BufferedReader(new InputStreamReader(cmdProc.getInputStream()));
StringBuilder output = new StringBuilder();
String line;
try {
while((line = in.readLine()) != null) {
output.append(line);
output.append("\n");
}
} catch (IOException e) {
throw new RuntimeException(e);
}
return output.toString();