假设在当前目录中有一些文件名为:
test1.out, test2.out, test3.out ...
个
test1.expect, test.expect, test3.expect ...
个
我想将每个测试.out与其对应的测试.expect进行比较,例如:
diff test1.out test1.expect
diff test2.out test2.expect
诸若此类.我想知道我如何才能更有效地实现这一点.谢谢!
我对Linuxshell 不是很熟悉.我try 过这样的事情:
for i in *.out; do diff "$i" "$i.expect"; done
个
但我意识到这是不正确的,因为$i
包括.out
扩展名.