【问题标题】:Plink is not returning to command prompt when executing start_http执行 start_http 时 Plink 未返回命令提示符
【发布时间】:2015-03-04 02:21:06
【问题描述】:

我正在通过 Windows 机器上的 Perl 文件使用 Plink 执行命令。

system("cmd /c c:\\plink.exe -batch -ssh -l $user_name @ $host_name  -pw  $pwd start_http");

执行挂起。当我从命令提示符执行相同的命令时,Plink 没有返回到命令提示符。

尝试在命令末尾使用&,但没有用。而且我不想将输出重定向到任何日志文件。

而“停止”命令工作正常

system("cmd /c c:\\plink.exe -batch -ssh -l $user_name @ $host_name  -pw  $pwd stop_http");

【问题讨论】:

  • 什么是start_http,当您在 SSH 终端中执行它时,它会返回到 shell 提示符吗?

标签: perl putty plink siebel


【解决方案1】:

stdout/err 必须与终端分离。

所以把命令改成

system("cmd /c c:\\plink.exe -batch -ssh -l $user_name @ $host_name  -pw  $pwd start_http /dev/null 2>&1 &");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-22
    • 2018-07-04
    • 1970-01-01
    • 2017-09-18
    • 1970-01-01
    • 2011-10-26
    • 1970-01-01
    • 2014-12-03
    相关资源
    最近更新 更多