【发布时间】:2014-05-20 04:54:52
【问题描述】:
我希望在 perl 脚本的变量中捕获 shell 命令的输出,只有管道“|”之前的命令的第一部分正在执行,执行脚本时没有错误
File.txt
Error input.txt got an error while parsing
Info output.txt has no error while parsing
my $var = `grep Error ./File.txt | awk '{print $2}'`;
print "Errored file $var";
Errored file Error input.txt 在解析时出错
我只想要被 awk 命令过滤但没有发生的 input.txt。请帮忙
【问题讨论】: