【发布时间】:2011-05-31 21:59:55
【问题描述】:
我有以下 perl 脚本
#!/usr/bin/perl
$userinput = <STDIN>;
chomp ($userinput);
while ( $userinput ne "DONE")
{
print STDOUT "User typed -----> $userinput\n";
$userinput = <STDIN>;
chomp ($userinput);
}
我已经在 unix 机器上复制了这个,在本地这工作正常,但是当我尝试使用 ssh 从另一个机器远程运行这个 perl 脚本时,它不起作用。
我正在使用以下命令运行此脚本。
ssh username@hostname /tmp/testremote.pl
它只是挂在 STDIN 上,不返回任何内容。
知道为什么这不起作用吗?
【问题讨论】:
-
明确一点:
/tmp/testremote.pl必须存在于 remote 机器上——是吗?