[英]How to send CTRL+C WITH JSCH?
I'm using jsch ChannelShell
to send commands to a remote system, but I can't send special commands like ctrl+c
. 我正在使用
jsch ChannelShell
将命令发送到远程系统,但是无法发送ctrl+c
类的特殊命令。 I tried many things, but have no success. 我尝试了很多事情,但没有成功。
Any help would be appreciated. 任何帮助,将不胜感激。
I think, i figured out my fault. 我想,我发现了我的错。 Cat and grep(and those type of commands) commands are one shot commands.
Cat和grep(以及那些类型的命令)命令是一键式命令。 They are not continuous.
它们不是连续的。 So I can't interrupt those commands.
所以我不能打扰那些命令。 I have to stop listening stream to stop printing outputs.
我必须停止监听流以停止打印输出。
if you want to terminate an operation like tail 如果您想终止像tail这样的操作
Example - BufferedReader reader = new BufferedReader(new InputStreamReader(ce.getInputStream()));
OutputStream out=ce.getOutputStream();
out.write(3); //terminate the tail command
out.flush();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.