Ant:Telnet无法运行

时间:2010-07-15 05:11:57

标签: ant telnet

我正在尝试以下Ant telnet任务:

 <telnet userid="uid" password="pass" server="${BT_Server}">
    <read>/u01/appldev/devappl/po/11.5.0/reports</read>
    <write>ls</write>
    <read string="/u01/appldev/devappl/po/11.5.0/reports"/>
 </telnet>

登录远程服务器后,它将执行无限次。得到以下信息:

构建文件:C:\ Program Files \ Java \ apache-ant-1.8.1 \ build.xml

sql_compile:
   [telnet] Unauthorised Access is Illegal
   [telnet] login:
   [telnet] uid
   [telnet]  Password:

我需要按ctrl + c强制终止作业。它给出了一条消息 - “终止批处理作业(是/否)?”

1 个答案:

答案 0 :(得分:0)

解决问题。实际读取等待UNIX提示符下出现的文本。

<telnet userid="uid" password="pass" server="${Server}">
    <read>authorisation (Y/N)? :</read>
    <write>y</write>
    <read>to continue</read>
    <write>\n</write>
    <read>/export/home/appldev></read4>
    <write>sh test_sql.sh "{$Release_Name}"</write>
    <read string="DEV - uid@host:/export/home/appldev>"/>
</telnet>