I'm trying to run the following command over SSH with JSch :
AlgoName -m /tmp/input1.txt -f /tmp/input2.txt > /tmp/output.txt
The value of exitStatus is 2. The command does not work over SSH with Jsch but it run successfully on the server.
My code:
ChannelExec channelExec = (ChannelExec) s.openChannel("exec");
channelExec.setCommand(command);
channelExec.connect();
int exitStatus = channelExec.getExitStatus();
channelExec.disconnect();