Ian*_*ris 4 linux redirection pipe
我有一个写入stdout的程序。有没有办法可以将输出重定向到 Linux diff命令,还是必须将输出写入文件然后进行比较?
例如,我有一堆程序的测试输入文件,以及另一组文件中相应的预期输出。我想做类似的事情./program < t1.input | diff t1.expected。
./program < t1.input | diff t1.expected
Ign*_*ams 5
在bash中:
diff t1.expected <(./program < t1.input)
gar*_*ohn 5
你也可以这样做:
./program < t1.input | diff t1.expected -
归档时间:
15 年,9 月 前
查看次数:
12652 次
最近记录:
12 年,1 月 前