【问题标题】:How can I use the shell's process substitution in Perl's system()?如何在 Perl 的 system() 中使用 shell 的进程替换?
【发布时间】:2009-08-14 20:00:00
【问题描述】:

为什么这行 Perl 会中断?

system("paste <\( cut -f2 $file \) $file2 > $fileout");

正确的做法是什么?

【问题讨论】:

    标签: linux perl unix


    【解决方案1】:

    这一般是因为 Perl 使用 sh 而不是 bash 来执行系统命令造成的。快速的答案是在命令的开头包含 bash -c。更好的答案在这里:

    How can I use bash syntax in Perl's system()?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-12
      • 1970-01-01
      • 1970-01-01
      • 2015-11-18
      • 1970-01-01
      • 2010-10-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多