Issue
I am trying to run a command on a remote Linux box from Java using JSch (SSH) API. The value of exitStatus
is -1
i.e.
int exitStatus = channelExec.getExitStatus()
What is the possible reason to get a negative value?
Solution
Note the documentation on getExitStatus().
The exit status will be -1 until the channel is closed.
Answered By - Damienknight Answer Checked By - Robin (WPSolving Admin)