【发布时间】:2021-06-06 23:38:53
【问题描述】:
在使用 Java 中的 JSch 库发送下一个命令之前,我无法确定命令是否已完成执行。
代码sn-p
// Opens a new channel of type 'exec'
Channel channel = sesConnection.openChannel("exec");
// sets the command to be executed
((ChannelExec) channel).setCommand(command);
// Gets an input stream for this channel
InputStream commandOutput = channel.getInputStream();
channel.connect();
【问题讨论】: