Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用 Jsch 执行需要确认的命令,如下所示:
>reboot Please confirm (y/n)? y
没有找到任何答案或有关如何执行此操作的文档。尝试执行“reboot”,然后读取输出直到“(y/n)?” 面对,然后将“y”打印到流中。虽然,到目前为止还没有运气。
在阅读 InputStream 并等待短语“请确认...”之后,您是否尝试过写入使用ChannelExec上的getOutputStream()获得的 OutputStream?