【发布时间】:2017-09-07 15:49:02
【问题描述】:
我正在尝试运行远程查找命令,但我必须将其值从用户的命令行参数中获取的局部变量传递给它。但是,我收到“未定义的变量”错误。我正在做类似的事情:
my $ssh = Net::OpenSSH->new($host);
#I am getting a part of the $path and $pattern from command line
#I have to look for $pattern at the $path
my @files = $ssh->capture(q(find $path -name $pattern) );
当我给出确切的路径和模式时,这个命令运行良好,但是当我用变量替换它时出现错误。
【问题讨论】:
标签: regex perl shell remote-access openssh