Removing shell stuff (like prompts) from command output in JSch

夙愿已清 提交于 2019-11-28 01:42:39

These are all consequences of the "shell" channel.

You run an interactive session with all the fancy stuff that human users like.

The "shell" channel is not intended for automation.

You may remove some of these by calling channel.setPty(false) before channel.connect().


Though you better use the "exec" channel.

This may work:

( echo username & echo password & echo hostname ) | command

Related questions:

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!