【发布时间】:2016-07-24 01:41:11
【问题描述】:
如何让 groovy(在本例中为 groovysh)调用 telnet 客户端,以便显示来自服务器的回复?
thufir@mordor:~$
thufir@mordor:~$ groovysh
Groovy Shell (1.8.6, JVM: 1.8.0_72)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------
groovy:000> 'telnet rainmaker.wunderground.com 3000'.execute()
===> java.lang.UNIXProcess@8458f04
groovy:000>
groovy:000> exit
thufir@mordor:~$
我知道有很多 Java telnet 库,但在这种情况下,我想将 telnet 作为 shell 命令执行。
【问题讨论】:
标签: linux shell groovy io telnet