N
nmlaney
I'm attempting to use this code on Linux, and only an empty String is
being logged. I tried this with String line = input.readline() and I'm
getting other debug stmts. I get the response on Windows, but not
Linux. What am I missing?
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader input = new BufferedReader(new
InputStreamReader(p.getInputStream()));
int ch;
StringBuffer sb = new StringBuffer("");
while ((ch = input.read()) != -1) {
sb.append(ch);
}
logger.debug(sb.toString());
input.close();
being logged. I tried this with String line = input.readline() and I'm
getting other debug stmts. I get the response on Windows, but not
Linux. What am I missing?
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader input = new BufferedReader(new
InputStreamReader(p.getInputStream()));
int ch;
StringBuffer sb = new StringBuffer("");
while ((ch = input.read()) != -1) {
sb.append(ch);
}
logger.debug(sb.toString());
input.close();