问题描述
chdir glob "/home/test/test1/test2/perl*";
@testList = exec "cat test.in | grep build | awk '{print \$2}'";
foreach my $testList(@testList) {
chdir "/home/test/test1/$testList";
exec "cat test.out | grep -w 'PASSED'";
}
chdir glob "/home/test/test1/test2/perl*";
@testList = exec "cat test.in | grep build | awk '{print \$2}'";
,但下面的其他两行除外。我只想要这些行的输出:
foreach my $testList(@testList) {
chdir "$opts->{/home/test/test1$testList";
exec "cat test.out | grep -w 'PASSED'";
不是
chdir glob "/home/test/test1/test2/perl*";
@testList = exec "cat test.in | grep build | awk '{print \$2}'";
请帮助。
解决方法
exec
和system
返回退出代码。
尝试:
@testList = `cat test.in | grep build | awk '{print \$2}'`;