I am using a JSCH -SSH library to execute command in \"shell\" channel, but unable to find a way to do 2 things:-
1) How to find whether the command is completely ex
For 2) u can use ByteArrayOutputStream
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
channel.setOutputStream(baos);
and then create new string from new String(baos.toByteArray())
For 1 have you tried to use 2>&1 at the end of your command?
String commandToRun = "ls /tmp/*.log 2>&1 \n";