标签: diff return-code
怎么可以
echo "a" > a echo "b" > a.new diff -u a a.new > a.patch patch -u -p1 < a.patch
在diff命令失败并返回代码1并且没有输出?
diff
1
答案 0 :(得分:0)
diff会返回1(有关返回代码的详细信息,请参阅What are the error exit values for diff?),即使stdout被重定向到不属于的文件中也是如此在我的观点中过于乐于助人。
stdout